Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Side by Side Diff: LayoutTests/http/tests/misc/performance-memory-in-dedicated-worker.html

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8" />
5 <title>window.performance.memory in dedicated workers</title>
6 <script src="/w3c/resources/testharness.js"></script>
7 <script src="/w3c/resources/testharnessreport.js"></script>
8 <script src="/w3c/webperf/resources/webperftestharness.js"></script>
9 <link rel="stylesheet" href="/w3c/resources/testharness.css" />
10 <script>
11 setup({explicit_done: true});
12
13 var tests = [
14 '"performance" in self;',
15 '"memory" in self.performance;',
16 'self.performance.memory;',
sof 2014/03/24 07:54:44 Change this to 'JSON.stringify(self.performance.me
17 ];
18
19 var worker = new Worker("/w3c/webperf/resources/worker.js");
20
21 worker.onmessage = function(event) {
22 var results = JSON.parse(event.data);
23 var jsHeap = results[2];
sof 2014/03/24 07:54:44 Move this down to just before it is used & explici
24 assert_true(results.length == 3);
25 test_true(results[0], "self.performance is defined");
26 test_true(results[1], "self.performance.memory is defined");
27 test_greater_or_equals(jsHeap.jsHeapSizeLimit, jsHeap.totalJSHeapSize, "jsHe apSizeLimit should be no less than totalJSHeapSize", {});
28 test_greater_or_equals(jsHeap.totalJSHeapSize, jsHeap.usedJSHeapSize, "total JSHeapSize should be no less than usedJSHeapSize", {});
29 done();
30 }
31
32 function start() {
33 worker.postMessage(tests);
34 }
35
36 window.addEventListener("load", start);
37 </script>
38 </head>
39 <body>
40 <h1>Description</h1>
41 <p>This test validates that performance.memory exists in dedicated workers </p>
42
43 <div id="log"></div>
44
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698