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

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

Issue 538323003: Have window.closed return true when frame is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Un-inline and improve formatting of Frame::setHasBeenClosed() Created 6 years, 3 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; 6 var jsTestIsAsync = true;
7 7
8 var oldChildWindow; 8 var oldChildWindow;
9 var newChildWindow; 9 var newChildWindow;
10 var propertiesToVerify = []; 10 var propertiesToVerify = [];
11 11
12 function insertExpectedResult(path, expected) 12 function insertExpectedResult(path, expected)
13 { 13 {
14 var propertyPath = path.join('.'); 14 var propertyPath = path.join('.');
15 propertiesToVerify.push({'property': "oldChildWindow." + propertyPath, 'expe cted': "newChildWindow." + propertyPath}); 15 propertiesToVerify.push({'property': "oldChildWindow." + propertyPath, 'expe cted': "newChildWindow." + propertyPath});
16 } 16 }
17 17
18 function runTest() 18 function runTest()
19 { 19 {
20 var frame = document.getElementById("frame"); 20 var frame = document.getElementById("frame");
21 if (frame.src != 'about:blank') { 21 if (frame.src != 'about:blank') {
22 description("Tests property access on a cached DOMWindow after the assoc iated frame is navigated. Test should not crash and properties read from the cac hed DOMWindow should be identical to properties through the 'current' DOMWindow. "); 22 description("Tests property access on a cached DOMWindow after the assoc iated frame is navigated. Test should not crash and properties read from the cac hed DOMWindow should be identical to properties through the 'current' DOMWindow. ");
23 oldChildWindow = frame.contentWindow; 23 oldChildWindow = frame.contentWindow;
24 collectProperties(); 24 // Have expected results assume that the frame hasn't been closed (=> wi ndow.closed = false.)
25 collectProperties(false);
25 frame.src = 'about:blank'; 26 frame.src = 'about:blank';
26 return; 27 return;
27 } 28 }
28 newChildWindow = frame.contentWindow; 29 newChildWindow = frame.contentWindow;
29 for (var i = 0; i < propertiesToVerify.length; ++i) 30 for (var i = 0; i < propertiesToVerify.length; ++i)
30 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected) ; 31 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected) ;
31 finishJSTest(); 32 finishJSTest();
32 } 33 }
33 </script> 34 </script>
34 </head> 35 </head>
35 <body> 36 <body>
36 <iframe id="frame" src="resources/blank.html" onload="runTest()"></iframe> 37 <iframe id="frame" src="resources/blank.html" onload="runTest()"></iframe>
37 </body> 38 </body>
38 </html> 39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698