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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Window/lookup-behavior.html

Issue 2452073002: Freeze global prototype chain per WebIDL (Closed)
Patch Set: Test improvements 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/Window/lookup-behavior.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/lookup-behavior.html b/third_party/WebKit/LayoutTests/fast/dom/Window/lookup-behavior.html
index f95904c853a87287115e9ca29d5638635deac758..d92ba22b8c9b4cee889aa3aefdf8d0eedd35e3f7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/lookup-behavior.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/lookup-behavior.html
@@ -29,10 +29,12 @@ test(function() {
anchor.id = 'myAnchor';
container.appendChild(anchor);
assert_equals(window.myAnchor, anchor, "Named access should work when WindowProperties is available.");
- // Remove the WindowProperties object from the prototype chain. This means,
- // 'window' no longer supports named access.
- Window.prototype.__proto__ = EventTarget.prototype;
- assert_equals(window.myAnchor, undefined, "Named access shouldn't work when WindowProperties is not available.");
+ // Look up the prototype chain and observe that the anchor is defined on the
+ // named properties object, no lower or higher.
+ assert_equals(window.__proto__.myAnchor, anchor, "Named access should work on Window.prototype");
+ assert_equals(window.__proto__.__proto__.myAnchor, anchor, "Named access should work on named properties object");
+ assert_equals(window.__proto__.__proto__.__proto__.myAnchor, undefined, "Named access does not work on EventTarget.prototype");
+ assert_equals(window.__proto__.__proto__.__proto__.__proto__.myAnchor, undefined, "Named access does not work on Object.prototype");
}, "WindowProperties object should provide named access.");
test(function() {
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698