gecko-dev/testing/web-platform/tests/device-memory/device-memory.https.any.js
Anne van Kesteren 5e1ef182e6 Bug 1631485 [wpt PR 23118] - *.any.js: add EOF newlines, a=testonly
Automatic update from web-platform-tests
*.any.js: add EOF newlines

--

wpt-commits: 61ff187c8d4548f996194b311449b62519a56c1e
wpt-pr: 23118
2020-04-28 11:32:01 +00:00

8 lines
468 B
JavaScript

test(function() {
assert_equals(typeof navigator.deviceMemory, "number",
"navigator.deviceMemory returns a number");
assert_true(navigator.deviceMemory >= 0,
"navigator.deviceMemory returns a positive value");
assert_true([0.25, 0.5, 1, 2, 4, 8].includes(navigator.deviceMemory),
"navigator.deviceMemory returns a power of 2 between 0.25 and 8");
}, "navigator.deviceMemory is a positive number, a power of 2, between 0.25 and 8");