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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/navigator-detached-no-crash.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../../resources/gc.js"></script>
6 </head> 7 </head>
7 <body> 8 <body>
8 <iframe id="subframe" src="about:blank"></iframe> 9 <iframe id="subframe" src="about:blank"></iframe>
9 <script> 10 <script>
10 11
11 var testNavigatorOnLoad = async_test("Accessing a navigator object that just got removed does not crash.") 12 var testNavigatorOnLoad = async_test("Accessing a navigator object that just got removed does not crash.")
12 var testNavigatorLater = async_test("Accessing a navigator object that got remov ed some time before does not crash.") 13 var testNavigatorLater = async_test("Accessing a navigator object that got remov ed some time before does not crash.")
13 14
14 // Reference to the removed navigator object. 15 // Reference to the removed navigator object.
15 var oldNav = null; 16 var oldNav = null;
16 17
17 function gc() {
18 if (window.GCController) {
19 GCController.collect();
20 } else {
21 for (var i = 0; i < 10000; i++) {
22 var s = new String("abc");
23 }
24 }
25 }
26
27 function test() { 18 function test() {
28 // Keep a reference of the navigator and remove the frame. 19 // Keep a reference of the navigator and remove the frame.
29 oldNav = window.frames[0].navigator; 20 oldNav = window.frames[0].navigator;
30 var frame = document.getElementById("subframe"); 21 var frame = document.getElementById("subframe");
31 frame.parentNode.removeChild(frame); 22 frame.parentNode.removeChild(frame);
32 23
33 if (window.GCController) 24 if (window.GCController)
34 window.GCController.collect(); 25 window.GCController.collect();
35 26
36 // Check once immediately. 27 // Check once immediately.
(...skipping 29 matching lines...) Expand all
66 } 57 }
67 } 58 }
68 } 59 }
69 60
70 window.addEventListener('load', test); 61 window.addEventListener('load', test);
71 62
72 </script> 63 </script>
73 64
74 </body> 65 </body>
75 </html> 66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698