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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html

Issue 2667393002: Stop using script-tests in fast/dom/. (Closed)
Patch Set: . Created 3 years, 11 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: third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html b/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html
index 024f4252aa4ee92529b2cce1c66635ac5931e181..733f16983beb5d825ee036de92fd439e88be7e9d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype.html
@@ -4,6 +4,27 @@
<script src="../../../resources/js-test.js"></script>
</head>
<body>
-<script src="script-tests/window-custom-prototype.js"></script>
+<script>
+description("Test what happens when you set the window's prototype to various values.");
+
+var originalWindowPrototype = __proto__;
+var chainPointingBackToWindow = { __proto__: window };
+var anotherObject = { };
+var error = "'TypeError: Immutable prototype object \\'#<Window>\\' cannot have their prototype set'";
+
+shouldThrow("__proto__ = window; __proto__", error);
+shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", error);
+shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype");
+shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype");
+shouldThrow("__proto__ = anotherObject; __proto__", error);
+shouldBe("anotherObject.__proto__ = window; __proto__", "originalWindowPrototype");
+shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype");
+shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype");
+shouldThrow("__proto__ = anotherObject; __proto__", error);
+shouldBe("__proto__ = originalWindowPrototype; __proto__", "originalWindowPrototype");
+shouldBe("anotherObject.__proto__ = window; anotherObject.__proto__", "window");
+shouldThrow("__proto__ = null; __proto__", error);
+shouldThrow("location.__proto__.__proto__ = location", "'TypeError: Cyclic __proto__ value'");
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698