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

Side by Side Diff: LayoutTests/fast/dom/Window/property-access-on-cached-properties-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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 childWindow; 8 var childWindow;
9 var propertiesToVerify = []; 9 var propertiesToVerify = [];
10 10
11 function insertExpectedResult(path, expected) 11 function insertExpectedResult(path, expected)
12 { 12 {
13 if (path.length < 2) 13 if (path.length < 2)
14 return; 14 return;
15 var propertyDir = path.slice(0, -1).join('.'); 15 var propertyDir = path.slice(0, -1).join('.');
16 var cachedPropertyDir = "cached_" + propertyDir.replace('.', '_'); 16 var cachedPropertyDir = "cached_" + propertyDir.replace('.', '_');
17 window[cachedPropertyDir] = eval("childWindow." + propertyDir); 17 window[cachedPropertyDir] = eval("childWindow." + propertyDir);
18 propertiesToVerify.push({ 18 propertiesToVerify.push({
19 'property': ["window", cachedPropertyDir, path[path.length - 1]].join(". "), 19 'property': ["window", cachedPropertyDir, path[path.length - 1]].join(". "),
20 'expected': expected, 20 'expected': expected,
21 }); 21 });
22 } 22 }
23 23
24 function runTest() 24 function runTest()
25 { 25 {
26 var frame = document.getElementById("frame"); 26 var frame = document.getElementById("frame");
27 if (frame.src != 'about:blank') { 27 if (frame.src != 'about:blank') {
28 description("Tests access of cached DOMWindow properties after the assoc iated frame is navigated. Test should not crash and properties should be set to sane defaults."); 28 description("Tests access of cached DOMWindow properties after the assoc iated frame is navigated. Test should not crash and properties should be set to sane defaults.");
29 childWindow = frame.contentWindow; 29 childWindow = frame.contentWindow;
30 collectProperties(); 30 // Have expected results assume that the frame hasn't been closed (=> wi ndow.closed = false.)
31 collectProperties(false);
31 frame.src = 'about:blank'; 32 frame.src = 'about:blank';
32 return; 33 return;
33 } 34 }
34 for (var i = 0; i < propertiesToVerify.length; ++i) 35 for (var i = 0; i < propertiesToVerify.length; ++i)
35 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected) ; 36 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected) ;
36 finishJSTest(); 37 finishJSTest();
37 } 38 }
38 </script> 39 </script>
39 </head> 40 </head>
40 <body> 41 <body>
41 <iframe id="frame" src="resources/blank.html" onload="runTest()"></iframe> 42 <iframe id="frame" src="resources/blank.html" onload="runTest()"></iframe>
42 </body> 43 </body>
43 </html> 44 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698