Index: LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html |
diff --git a/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html b/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1ac44230134cc7ca91493377d040f15ef00f179a |
--- /dev/null |
+++ b/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated.html |
@@ -0,0 +1,38 @@ |
+<html> |
+<head> |
+<script src="../../../resources/js-test.js"></script> |
+<script src="resources/window-property-collector.js"></script> |
+<script> |
+var jsTestIsAsync = true; |
+ |
+var oldChildWindow; |
+var newChildWindow; |
+var propertiesToVerify = []; |
+ |
+function insertExpectedResult(path, expected) |
+{ |
+ var propertyPath = path.join('.'); |
+ propertiesToVerify.push({'property': "oldChildWindow." + propertyPath, 'expected': "newChildWindow." + propertyPath}); |
+} |
+ |
+function runTest() |
+{ |
+ var frame = document.getElementById("frame"); |
+ if (frame.src != 'about:blank') { |
+ 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."); |
+ oldChildWindow = frame.contentWindow; |
+ collectProperties(); |
+ frame.src = 'about:blank'; |
+ return; |
+ } |
+ newChildWindow = frame.contentWindow; |
+ for (var i = 0; i < propertiesToVerify.length; ++i) |
+ shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected); |
+ finishJSTest(); |
+} |
+</script> |
+</head> |
+<body> |
+<iframe id="frame" src="resources/blank.html" onload="runTest()"></iframe> |
+</body> |
+</html> |