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

Side by Side Diff: LayoutTests/fast/dom/DOMException/resources/XPathException.js

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 description("Tests the properties of the XPathException object.") 1 description("Tests the properties of the XPathException object.")
2 2
3 var e; 3 var e;
4 try { 4 try {
5 var evalulator = new XPathEvaluator; 5 var evalulator = new XPathEvaluator;
6 var nsResolver = evalulator.createNSResolver(document); 6 var nsResolver = evalulator.createNSResolver(document);
7 var result = evalulator.evaluate("/body", document, nsResolver, 0, null); 7 var result = evalulator.evaluate("/body", document, nsResolver, 0, null);
8 var num = result.numberValue; 8 var num = result.numberValue;
9 // raises a TYPE_ERR 9 // raises a TYPE_ERR
10 } catch (err) { 10 } catch (err) {
11 e = err; 11 e = err;
12 } 12 }
13 13
14 shouldBeEqualToString("e.toString()", "Error: TYPE_ERR: DOM XPath Exception 52") ; 14 shouldBeEqualToString("e.toString()", "TYPE_ERR: The expression could not be con verted to return the specified type.");
15 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object XPathExcepti on]"); 15 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object XPathExcepti on]");
16 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object XP athExceptionPrototype]"); 16 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object XP athExceptionPrototype]");
17 shouldBeEqualToString("e.constructor.toString()", "function XPathException() { [ native code] }"); 17 shouldBeEqualToString("e.constructor.toString()", "function XPathException() { [ native code] }");
18 shouldBe("e.constructor", "window.XPathException"); 18 shouldBe("e.constructor", "window.XPathException");
19 shouldBe("e.TYPE_ERR", "e.constructor.TYPE_ERR"); 19 shouldBe("e.TYPE_ERR", "e.constructor.TYPE_ERR");
20 shouldBe("e.INVALID_EXPRESSION_ERR", "51"); 20 shouldBe("e.INVALID_EXPRESSION_ERR", "51");
21 shouldBe("e.TYPE_ERR", "52"); 21 shouldBe("e.TYPE_ERR", "52");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698