blob: 42829c949393a528d58f6416206004233dfc70da [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="/w3c/resources/testharness.js"></script>
<script src="/w3c/resources/testharnessreport.js"></script>
<link rel="stylesheet" href="/w3c/resources/testharness.css" />
<script>
test(() => {
assert_true(performance != undefined, 'performance is defined.');
assert_true(performance.memory != undefined, 'performance.memory is defined.');
const memoryInfo = performance.memory;
assert_true(memoryInfo.jsHeapSizeLimit != undefined, 'performance.memory.jsHeapSizeLimit is defined');
assert_true(memoryInfo.totalJSHeapSize != undefined, 'performance.memory.totalJSHeapSize is defined');
assert_true(memoryInfo.usedJSHeapSize != undefined, 'performance.memory.usedJSHeapSize is defined');
assert_greater_than_equal(memoryInfo.jsHeapSizeLimit, memoryInfo.totalJSHeapSize, "jsHeapSizeLimit should be no less than totalJSHeapSize", {});
// TODO(npm): memoryInfo.totalJSHeapSize should be greater than or equal to
// memoryInfo.totalJSHeapSize, but this is not always the case.
// See https://crbug.com/849322.
});
</script>
</head>
<body>
<h1>Description</h1>
<p>This test validates that performance.memory exists in dedicated workers </p>
</body>
</html>