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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/message-channel-gc.html

Issue 2847943002: Cleanup LayoutTests that define a function gc(). (Closed)
Patch Set: Fixing Layout Tests Failures Created 3 years, 7 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
1 <body> 1 <body>
2 <p>Test some cases of MessagePort garbage collection.</p> 2 <p>Test some cases of MessagePort garbage collection.</p>
3 <pre id=log></pre> 3 <pre id=log></pre>
4 <script src="../../resources/gc.js"></script>
4 <script> 5 <script>
5 function gc()
6 {
7 if (window.GCController)
8 return GCController.collect();
9
10 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
11 var s = new String("abc");
12 }
13 }
14 6
15 function log(message) 7 function log(message)
16 { 8 {
17 document.getElementById("log").innerHTML += message + "<br>"; 9 document.getElementById("log").innerHTML += message + "<br>";
18 } 10 }
19 11
20 function done() 12 function done()
21 { 13 {
22 channel.port1.close(); 14 channel.port1.close();
23 channel.port2.close(); 15 channel.port2.close();
(...skipping 20 matching lines...) Expand all
44 channel.port1.addEventListener("message", function() { log("message listener"); done(); }, false); 36 channel.port1.addEventListener("message", function() { log("message listener"); done(); }, false);
45 37
46 gc(); 38 gc();
47 channel.port1.start(); 39 channel.port1.start();
48 channel.port2.postMessage("msg"); 40 channel.port2.postMessage("msg");
49 41
50 gc(); 42 gc();
51 43
52 </script> 44 </script>
53 </body> 45 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698