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

Side by Side Diff: LayoutTests/fast/dom/DOMException/prototype-object.html

Issue 16818023: DOMException toString is not correct (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 months 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../js/resources/js-test-pre.js"></script> 2 <script src="../../js/resources/js-test-pre.js"></script>
3 <script> 3 <script>
4 4
5 description("This tests the prototype chain of DOMException objects.") 5 description("This tests the prototype chain of DOMException objects.")
6 6
7 var e; 7 var e;
8 try { 8 try {
9 document.appendChild(document); 9 document.appendChild(document);
10 // raises a HIERARCHY_REQUEST_ERR 10 // raises a HIERARCHY_REQUEST_ERR
11 } catch (err) { 11 } catch (err) {
12 e = err; 12 e = err;
13 } 13 }
14 14
15 shouldBeEqualToString("e.toString()", "Error: HierarchyRequestError: DOM Excepti on 3"); 15 shouldBeEqualToString("e.toString()", "HierarchyRequestError: A Node was inserte d somewhere it doesn't belong.");
16 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMException ]"); 16 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMException ]");
17 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object DO MExceptionPrototype]"); 17 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object DO MExceptionPrototype]");
18 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__.__proto__)", " [object Error]"); 18 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__.__proto__)", " [object Error]");
19 shouldBeEqualToString("e.constructor.toString()", "function DOMException() { [na tive code] }"); 19 shouldBeEqualToString("e.constructor.toString()", "function DOMException() { [na tive code] }");
20 shouldBeTrue("e instanceof DOMException"); 20 shouldBeTrue("e instanceof DOMException");
21 shouldBeTrue("e instanceof Error"); 21 shouldBeTrue("e instanceof Error");
22 shouldBe("e.constructor", "window.DOMException"); 22 shouldBe("e.constructor", "window.DOMException");
23 shouldBe("e.HIERARCHY_REQUEST_ERR", "e.constructor.HIERARCHY_REQUEST_ERR"); 23 shouldBe("e.HIERARCHY_REQUEST_ERR", "e.constructor.HIERARCHY_REQUEST_ERR");
24 shouldBe("e.HIERARCHY_REQUEST_ERR", "3"); 24 shouldBe("e.HIERARCHY_REQUEST_ERR", "3");
25 shouldBe("e.code", "3"); 25 shouldBe("e.code", "3");
26 shouldBeEqualToString("e.name", "HierarchyRequestError"); 26 shouldBeEqualToString("e.name", "HierarchyRequestError");
27 shouldBeEqualToString("e.message", "HierarchyRequestError: DOM Exception 3"); 27 shouldBeEqualToString("e.message", "A Node was inserted somewhere it doesn't bel ong.");
28 28
29 </script> 29 </script>
30 <script src="../../js/resources/js-test-post.js"></script> 30 <script src="../../js/resources/js-test-post.js"></script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698