Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Window / property-access-on-cached-window-after-frame-removed-and-gced.html
blob200654bc1fc0b275dbab9b5222e3cece135d8566
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/window-property-collector.js"></script>
5 <script>
6 var jsTestIsAsync = true;
8 var childWindow;
9 var propertiesToVerify = [];
11 function insertExpectedResult(path, expected)
13 var propertyPath = path.join('.');
14 propertiesToVerify.push({'property': "childWindow." + propertyPath, 'expected': expected});
17 function runTest()
19 description("Tests property access on a cached DOMWindow after the associated frame is removed from a web page and garbage collected. Test should not crash and properties should be set to sane defaults.");
20 var frame = document.getElementById("frame");
21 childWindow = frame.contentWindow;
22 // Have expected results assume that the frame has been closed and GCed (=> window.closed = true.)
23 collectProperties(true);
24 frame.parentNode.removeChild(frame);
25 asyncGC(function () {
26 for (var i = 0; i < propertiesToVerify.length; ++i)
27 shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected);
28 finishJSTest();
29 });
31 </script>
32 </head>
33 <body>
34 <iframe id="frame" src="about:blank" onload="runTest()"></iframe>
35 </body>
36 </html>