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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 &lt;HTML ELEMENT&gt;.toString.toString doesn't change the output of &lt;HTML ELEMENT&gt;.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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698