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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Window/script-tests/window-custom-prototype.js

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 unified diff | Download patch
OLDNEW
1 description("Test what happens when you set the window's prototype to various va lues."); 1 description("Test what happens when you set the window's prototype to various va lues.");
2 2
3 var originalWindowPrototype = __proto__; 3 var originalWindowPrototype = __proto__;
4 var chainPointingBackToWindow = { __proto__: window }; 4 var chainPointingBackToWindow = { __proto__: window };
5 var anotherObject = { }; 5 var anotherObject = { };
6 var error = "'TypeError: Immutable prototype object \\'#<Window>\\' cannot have their prototype set'";
6 7
7 shouldThrow("__proto__ = window; __proto", "'TypeError: Cyclic __proto__ value'" ); 8 shouldThrow("__proto__ = window; __proto__", error);
8 shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", "'TypeError: Cyc lic __proto__ value'"); 9 shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", error);
9 shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype"); 10 shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype");
10 shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype"); 11 shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype");
11 shouldBe("__proto__ = anotherObject; __proto__", "anotherObject"); 12 shouldThrow("__proto__ = anotherObject; __proto__", error);
12 shouldThrow("anotherObject.__proto__ = window; __proto__", "'TypeError: Cyclic _ _proto__ value'"); 13 shouldBe("anotherObject.__proto__ = window; __proto__", "originalWindowPrototype ");
13 shouldBe("__proto__ = 1; __proto__", "anotherObject"); 14 shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype");
14 shouldBe("__proto__ = 'a string'; __proto__", "anotherObject"); 15 shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype");
15 shouldBe("__proto__ = anotherObject; __proto__", "anotherObject"); 16 shouldThrow("__proto__ = anotherObject; __proto__", error);
16 shouldBe("__proto__ = originalWindowPrototype; __proto__", "originalWindowProtot ype"); 17 shouldBe("__proto__ = originalWindowPrototype; __proto__", "originalWindowProtot ype");
17 shouldBe("anotherObject.__proto__ = window; anotherObject.__proto__", "window"); 18 shouldBe("anotherObject.__proto__ = window; anotherObject.__proto__", "window");
18 shouldBe("__proto__ = null; window.__proto__", "undefined"); 19 shouldThrow("__proto__ = null; __proto__", error);
20 shouldThrow("location.__proto__.__proto__ = location", "'TypeError: Cyclic __pro to__ value'");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698