Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <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.
| |
| 3 <script src="../../../resources/testharness.js"></script> | |
| 4 <script src="../../../resources/testharnessreport.js"></script> | |
| 5 <p>Test that HTML element constructors' toString is just Function.prototype.to String, and that changing <HTML ELEMENT>.toString.toString doesn't change the output of <HTML ELEMENT>.toString().</p> | |
| 6 <script> | |
| 7 test(function() { | |
| 8 assert_equals(HTMLElement.toString(), "function HTMLElement() { [nativ e code] }"); | |
| 9 assert_equals(HTMLElement.toString, Function.prototype.toString); | |
| 10 }, "HTMLElement.toString should be Function.prototype.toString"); | |
| 11 | |
| 12 test(function() { | |
| 13 assert_equals(HTMLElement.toString.toString(), "function toString() { [native code] }"); | |
| 14 assert_equals(HTMLElement.toString.toString, Function.prototype.toStri ng); | |
| 15 }, "HTMLElement.toString.toString should be Function.prototype.toString"); | |
| 16 | |
| 17 HTMLElement.toString.toString = function() { return "foobar"; } | |
| 18 | |
| 19 test(function() { | |
| 20 assert_equals(HTMLElement.toString.toString(), "foobar"); | |
| 21 assert_equals(HTMLElement.toString(), "function HTMLElement() { [nativ e code] }"); | |
| 22 assert_equals(HTMLElement.toString, Function.prototype.toString); | |
| 23 }, "After changing HTMLElement.toString.toString, HTMLElement.toString sho uld still be Function.prototype.toString"); | |
| 24 | |
| 25 test(function() { | |
| 26 assert_equals(HTMLDivElement.toString.toString(), "foobar"); | |
| 27 assert_equals(HTMLDivElement.toString(), "function HTMLDivElement() { [native code] }"); | |
| 28 assert_equals(HTMLDivElement.toString, Function.prototype.toString); | |
| 29 }, "After changing HTMLElement.toString.toString, HTMLDivElement.toString should still be Function.prototype.toString"); | |
| 30 </script> | |
| 31 </body> | |
| OLD | NEW |