Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / Window / property-access-on-cached-window-after-frame-navigated.html
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;
7
8 var oldChildWindow;
9 var newChildWindow;
10 var propertiesToVerify = [];
11
12 function insertExpectedResult(path, expected)
13 {
14     var propertyPath = path.join('.');
15     propertiesToVerify.push({'property': "oldChildWindow." + propertyPath, 'expected': "newChildWindow." + propertyPath});
16 }
17
18 function runTest()
19 {
20     var frame = document.getElementById("frame");
21     if (frame.src != 'about:blank') {
22         description("Tests property access on a cached DOMWindow after the associated frame is navigated. Test should not crash and properties read from the cached DOMWindow should be identical to properties through the 'current' DOMWindow.");
23         oldChildWindow = frame.contentWindow;
24         // Have expected results assume that the frame hasn't been closed (=> window.closed = false.)
25         collectProperties(false);
26         frame.src = 'about:blank';
27         return;
28     }
29     newChildWindow = frame.contentWindow;
30     for (var i = 0; i < propertiesToVerify.length; ++i)
31         shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected);
32     finishJSTest();
33 }
34 </script>
35 </head>
36 <body>
37 <iframe id="frame" src="resources/blank.html" onload="runTest()"></iframe>
38 </body>
39 </html>