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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html

Issue 1497503002: Removes the custom toString callback for the various DOM constructors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: testharness.js Created 5 years 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/element-constructors-to-string.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html b/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html
new file mode 100644
index 0000000000000000000000000000000000000000..596f72884050c4c429c4ffbe6a1df6038a72eb96
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<body>
jochen (gone - plz use gerrit) 2015/12/03 12:09:11 you don't need a body
epertoso 2015/12/03 13:01:00 Done.
+ <script src="../../../resources/testharness.js"></script>
+ <script src="../../../resources/testharnessreport.js"></script>
+ <p>Test that HTML element constructors' toString is just Function.prototype.toString, and that changing &lt;HTML ELEMENT&gt;.toString.toString doesn't change the output of &lt;HTML ELEMENT&gt;.toString().</p>
+ <script>
+ test(function() {
+ assert_equals(HTMLElement.toString(), "function HTMLElement() { [native code] }");
+ assert_equals(HTMLElement.toString, Function.prototype.toString);
+ }, "HTMLElement.toString should be Function.prototype.toString");
+
+ test(function() {
+ assert_equals(HTMLElement.toString.toString(), "function toString() { [native code] }");
+ assert_equals(HTMLElement.toString.toString, Function.prototype.toString);
+ }, "HTMLElement.toString.toString should be Function.prototype.toString");
+
+ HTMLElement.toString.toString = function() { return "foobar"; }
+
+ test(function() {
+ assert_equals(HTMLElement.toString.toString(), "foobar");
+ assert_equals(HTMLElement.toString(), "function HTMLElement() { [native code] }");
+ assert_equals(HTMLElement.toString, Function.prototype.toString);
+ }, "After changing HTMLElement.toString.toString, HTMLElement.toString should still be Function.prototype.toString");
+
+ test(function() {
+ assert_equals(HTMLDivElement.toString.toString(), "foobar");
+ assert_equals(HTMLDivElement.toString(), "function HTMLDivElement() { [native code] }");
+ assert_equals(HTMLDivElement.toString, Function.prototype.toString);
+ }, "After changing HTMLElement.toString.toString, HTMLDivElement.toString should still be Function.prototype.toString");
+ </script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698