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

Unified Diff: LayoutTests/fast/dom/Window/resources/window-property-collector.js

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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/Window/resources/window-property-collector.js
diff --git a/LayoutTests/fast/dom/Window/resources/window-property-collector.js b/LayoutTests/fast/dom/Window/resources/window-property-collector.js
index a19048243ffc5f19b8fb8449525476d4fff4c23c..0e1a698c6e2fe01afe4f2ba46115ef6ebf9e7a81 100644
--- a/LayoutTests/fast/dom/Window/resources/window-property-collector.js
+++ b/LayoutTests/fast/dom/Window/resources/window-property-collector.js
@@ -1,8 +1,8 @@
-function collectProperties()
+function collectProperties(windowHasBeenGCed)
{
// Collect properties of the top-level window, since touching the properties
// of a DOMWindow affects its internal C++ state.
- collectPropertiesHelper(window, []);
+ collectPropertiesHelper(window, windowHasBeenGCed, []);
propertiesToVerify.sort(function (a, b)
{
@@ -80,7 +80,7 @@ function emitExpectedResult(path, expected)
insertExpectedResult(path, expected);
}
-function collectPropertiesHelper(object, path)
+function collectPropertiesHelper(object, windowHasBeenGCed, path)
{
if (path.length > 20)
throw 'Error: probably looping';
@@ -99,14 +99,17 @@ function collectPropertiesHelper(object, path)
&& !(object[property] instanceof MimeTypeArray)
&& !(object[property] instanceof PluginArray)) {
// Skip some traversing through types that will end up in cycles...
- collectPropertiesHelper(object[property], path);
+ collectPropertiesHelper(object[property], windowHasBeenGCed, path);
}
} else if (type == "string") {
emitExpectedResult(path, "''");
} else if (type == "number") {
emitExpectedResult(path, "0");
} else if (type == "boolean") {
- emitExpectedResult(path, "false");
+ expected = "false";
+ if (path == "closed" && windowHasBeenGCed )
+ expected = "true";
+ emitExpectedResult(path, expected);
}
path.pop();
}

Powered by Google App Engine
This is Rietveld 408576698