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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html

Issue 2501333002: binding: Makes window/frames/self attributes return itself. (Closed)
Patch Set: Completely stopped using cached accessors. Created 4 years, 1 month 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: third_party/WebKit/LayoutTests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html b/third_party/WebKit/LayoutTests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html
index c951920a97d191712152a82cfe4ef28b425f97a5..e9dff7d0d70ce816c0368596d12330ccbce8928e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/resources/property-access-in-closure-after-navigation-child.html
@@ -4,28 +4,41 @@
<script>
function startTest()
{
- t = window.top;
- t.shouldBe("window", "self");
- t.shouldBe("window", "frames");
- t.shouldBe("parent", "top");
- t.savedClosure = function()
+ t = window.top;
+ t.shouldBe("window", "self");
+ t.shouldBe("window", "frames");
+ t.shouldBe("parent", "top");
+ t.savedClosure = () => {
+ // The normal shouldBeNull() helpers don't work well here, since they don't
+ // eval in the right context.
+ function shouldBeNull(value, name)
{
- // The normal shouldBeNull() helpers don't work well here, since they don't eval
- //in the right context.
- function testProperty(value, name)
- {
- if (value === null)
- t.testPassed(name + " is null.");
- else
- t.testFailed(name + " is not null!");
- }
- testProperty(window, "window");
- testProperty(self, "self");
- testProperty(frames, "frames");
- testProperty(parent, "parent");
- testProperty(top, "top");
- };
- location = 'data:text/html,<body>Testing...</body>';
+ if (value === null)
+ t.testPassed(name + " is null.");
+ else
+ t.testFailed(name + " should be null. Was " + value);
+ }
+ function shouldBeNonNull(value, name) {
+ if (value != null)
+ t.testPassed(name + " is non-null.");
+ else
+ t.testFailed(name + " should be non-null. Was " + value);
+ }
+
+ // window, self and frames never be null.
+ // https://html.spec.whatwg.org/multipage/browsers.html#dom-window
+ shouldBeNonNull(window, "window");
+ shouldBeNonNull(self, "self");
+ shouldBeNonNull(frames, "frames");
+
+ // top and parent are null if there is no browsing context with the
+ // WindowProxy.
+ // https://html.spec.whatwg.org/multipage/browsers.html#dom-top
+ // https://html.spec.whatwg.org/multipage/browsers.html#dom-parent
+ shouldBeNull(parent, "parent");
+ shouldBeNull(top, "top");
+ };
+ location = 'data:text/html,<body>Testing...</body>';
}
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698