| Index: LayoutTests/http/tests/misc/performance-memory-in-dedicated-worker.html
|
| diff --git a/LayoutTests/http/tests/misc/performance-memory-in-dedicated-worker.html b/LayoutTests/http/tests/misc/performance-memory-in-dedicated-worker.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c420d7bad4a14e759d874a25f8696aa80972c4e8
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/misc/performance-memory-in-dedicated-worker.html
|
| @@ -0,0 +1,46 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<meta charset="utf-8" />
|
| +<title>window.performance.memory in dedicated workers</title>
|
| +<script src="/w3c/resources/testharness.js"></script>
|
| +<script src="/w3c/resources/testharnessreport.js"></script>
|
| +<script src="/w3c/webperf/resources/webperftestharness.js"></script>
|
| +<link rel="stylesheet" href="/w3c/resources/testharness.css" />
|
| +<script>
|
| +setup({explicit_done: true});
|
| +
|
| +var tests = [
|
| + '"performance" in self;',
|
| + '"memory" in self.performance;',
|
| + 'JSON.stringify(self.performance.memory);',
|
| +];
|
| +
|
| +var worker = new Worker("/w3c/webperf/resources/worker.js");
|
| +
|
| +worker.onmessage = function(event) {
|
| + var results = event.data;
|
| + assert_true(results.length == 3);
|
| + test_true(results[0], "self.performance is defined");
|
| + test_true(results[1], "self.performance.memory is defined");
|
| + var jsHeap = JSON.parse(results[2]);
|
| + test_greater_or_equals(jsHeap.jsHeapSizeLimit, jsHeap.totalJSHeapSize, "jsHeapSizeLimit should be no less than totalJSHeapSize", {});
|
| + test_greater_or_equals(jsHeap.totalJSHeapSize, jsHeap.usedJSHeapSize, "totalJSHeapSize should be no less than usedJSHeapSize", {});
|
| + done();
|
| +}
|
| +
|
| +function start() {
|
| + worker.postMessage(tests);
|
| +}
|
| +
|
| +window.addEventListener("load", start);
|
| +</script>
|
| +</head>
|
| +<body>
|
| +<h1>Description</h1>
|
| +<p>This test validates that performance.memory exists in dedicated workers </p>
|
| +
|
| +<div id="log"></div>
|
| +
|
| +</body>
|
| +</html>
|
|
|