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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed.html

Issue 1475863005: [Async][WIP] Call FrameLoader::checkCompleted() asynchronously to avoid sync body.onload() Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../resources/js-test.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/window-property-collector.js"></script> 4 <script src="resources/window-property-collector.js"></script>
5 <script> 5 <script>
6 var jsTestIsAsync = true;
7
6 var childWindow; 8 var childWindow;
7 var propertiesToVerify = []; 9 var propertiesToVerify = [];
8 10
9 function insertExpectedResult(path, expected) 11 function insertExpectedResult(path, expected)
10 { 12 {
11 var propertyPath = path.join('.'); 13 var propertyPath = path.join('.');
12 propertiesToVerify.push({'property': "childWindow." + propertyPath, 'expecte d': expected}); 14 propertiesToVerify.push({'property': "childWindow." + propertyPath, 'expecte d': expected});
13 } 15 }
14 16
15 function runTest() 17 function runTest()
16 { 18 {
17 description("Tests property access on a cached DOMWindow after the associate d frame is no longer in a web page. Test should not crash and properties should be set to sane defaults."); 19 description("Tests property access on a cached DOMWindow after the associate d frame is no longer in a web page. Test should not crash and properties should be set to sane defaults.");
18 var frame = document.getElementById("frame"); 20 var frame = document.getElementById("frame");
19 childWindow = frame.contentWindow; 21 childWindow = frame.contentWindow;
20 // Have expected results assume that the frame has been closed (=> window.cl osed = true.) 22 // Have expected results assume that the frame has been closed (=> window.cl osed = true.)
21 collectProperties(true); 23 collectProperties(true);
22 frame.parentNode.removeChild(frame); 24 frame.parentNode.removeChild(frame);
23 for (var i = 0; i < propertiesToVerify.length; ++i) 25 for (var i = 0; i < propertiesToVerify.length; ++i)
24 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected) ; 26 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected) ;
27 finishJSTest();
25 } 28 }
26 </script> 29 </script>
27 </head> 30 </head>
28 <body> 31 <body>
29 <iframe id="frame" src="about:blank" onload="runTest()"></iframe> 32 <iframe id="frame" src="about:blank" onload="runTest()"></iframe>
30 </body> 33 </body>
31 </html> 34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698