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

Unified Diff: LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html

Issue 131113003: Fix DOMWindow::isCurrentlyDisplayedInFrame to return false when detached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix ScreenOrientation + test window.open. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html
diff --git a/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html b/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html
new file mode 100644
index 0000000000000000000000000000000000000000..ca82951736706a16a85f083f2ed2ce97d7d424b5
--- /dev/null
+++ b/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script src="resources/window-property-collector.js"></script>
+<script>
+var childWindow;
+var propertiesToVerify = [];
+
+function insertExpectedResult(path, expected)
+{
+ if (path.length < 2)
+ return;
+ var propertyDir = path.slice(0, -1).join('.');
+ var cachedPropertyDir = "cached_" + propertyDir.replace('.', '_');
+ window[cachedPropertyDir] = eval("childWindow." + propertyDir);
+ propertiesToVerify.push({
+ 'property': ["window", cachedPropertyDir, path[path.length - 1]].join("."),
+ 'expected': expected,
+ });
+}
+
+function runTest()
+{
+ description("Tests access of cached DOMWindow properties after the associated frame is no longer in a web page. Test should not crash and properties should be set to sane defaults.");
+ var frame = document.getElementById("frame");
+ childWindow = frame.contentWindow;
+ collectProperties();
+ frame.parentNode.removeChild(frame);
+ for (var i = 0; i < propertiesToVerify.length; ++i)
+ shouldBe(propertiesToVerify[i].property, propertiesToVerify[i].expected);
+}
+</script>
+</head>
+<body>
+<iframe id="frame" src="about:blank" onload="runTest()"></iframe>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698