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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/XMLHttpRequestException.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 <html> 1 <html>
2 <body> 2 <body>
3 <p>Tests the properties of XMLHttpRequest exceptions.</p> 3 <p>Tests the properties of XMLHttpRequest exceptions.</p>
4 <pre id="console"></pre> 4 <pre id="console"></pre>
5 <script> 5 <script>
6 function shouldBeEqualToString(__a, __b) 6 function shouldBeEqualToString(__a, __b)
7 { 7 {
8 var _a = eval(__a); 8 var _a = eval(__a);
9 9
10 var _message; 10 var _message;
(...skipping 25 matching lines...) Expand all
36 var e; 36 var e;
37 try { 37 try {
38 var req = new XMLHttpRequest; 38 var req = new XMLHttpRequest;
39 req.open('GET', 'resources/infinite-loop.php', false); 39 req.open('GET', 'resources/infinite-loop.php', false);
40 req.send(null); 40 req.send(null);
41 // raises NETWORK_ERR 41 // raises NETWORK_ERR
42 } catch (err) { 42 } catch (err) {
43 e = err; 43 e = err;
44 } 44 }
45 45
46 shouldBeEqualToString("e.toString()", "Error: NetworkError: DOM Exception 19 "); 46 shouldBeEqualToString("e.toString()", "NetworkError: A network error occurre d.");
47 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMExcep tion]"); 47 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMExcep tion]");
48 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[objec t DOMExceptionPrototype]"); 48 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[objec t DOMExceptionPrototype]");
49 shouldBeEqualToString("e.constructor.toString()", "function DOMException() { [native code] }"); 49 shouldBeEqualToString("e.constructor.toString()", "function DOMException() { [native code] }");
50 shouldBe("e.constructor", "window.DOMException"); 50 shouldBe("e.constructor", "window.DOMException");
51 shouldBe("e.NETWORK_ERR", "e.constructor.NETWORK_ERR"); 51 shouldBe("e.NETWORK_ERR", "e.constructor.NETWORK_ERR");
52 shouldBe("e.NETWORK_ERR", "19"); 52 shouldBe("e.NETWORK_ERR", "19");
53 </script> 53 </script>
54 </body> 54 </body>
55 </html> 55 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698