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..d2835ba20188cbb8d668329d38332db34a9a9ebb |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/element-constructors-to-string.html |
@@ -0,0 +1,28 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<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> |