Chromium Code Reviews| 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 <HTML ELEMENT>.toString.toString doesn't change the output of <HTML ELEMENT>.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> |