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

Side by Side Diff: sky/tests/framework/xmlhttprequest/xhr-does-not-exist.sky

Issue 881093003: Normalize import paths for Sky modules (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
OLDNEW
1 <sky> 1 <sky>
2 <import src="/sky/tests/resources/chai.sky" /> 2 <import src="../../resources/chai.sky" />
3 <import src="/sky/tests/resources/mocha.sky" /> 3 <import src="../../resources/mocha.sky" />
4 <import src="/sky/framework/xmlhttprequest.sky" as="XMLHttpRequest" /> 4 <import src="/sky/framework/xmlhttprequest.sky" as="XMLHttpRequest" />
5 <script> 5 <script>
6 describe("xmlhttprequest", function() { 6 describe("xmlhttprequest", function() {
7 it("should call onerror when endpoint does not exist", function(done) { 7 it("should call onerror when endpoint does not exist", function(done) {
8 var xhr = new XMLHttpRequest(); 8 var xhr = new XMLHttpRequest();
9 xhr.open("GET", "does_not_exist.html"); 9 xhr.open("GET", "does_not_exist.html");
10 xhr.onerror = function() { 10 xhr.onerror = function() {
11 assert.fail("onload", "onerror", "onerror should not be called."); 11 assert.fail("onload", "onerror", "onerror should not be called.");
12 done(); 12 done();
13 } 13 }
14 xhr.onload = function() { 14 xhr.onload = function() {
15 // Missing files are application-level errors, not network errors 15 // Missing files are application-level errors, not network errors
16 // so onload fires, not onerror. 16 // so onload fires, not onerror.
17 assert.equal(xhr.status, 404); 17 assert.equal(xhr.status, 404);
18 assert.equal(xhr.statusText, "HTTP/1.1 404 Not Found", 18 assert.equal(xhr.statusText, "HTTP/1.1 404 Not Found",
19 "status text should also be 404"); 19 "status text should also be 404");
20 done(); 20 done();
21 } 21 }
22 xhr.send(); 22 xhr.send();
23 }); 23 });
24 }); 24 });
25 </script> 25 </script>
26 </sky> 26 </sky>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698