Bug 1228222 Don't try to access ftp::/localhost to test "unknown server". r=asuth
authorBen Kelly <ben@wanderview.com>
Wed, 25 May 2016 07:55:53 -0700
changeset 370997 915fe75544021565c55933cb978f858542a8babb
parent 370996 b050868120226fbcf67bf0c4d162755ea656f7ac
child 370998 8b5b058bf71fb886d8308496a80d66e8f407e8e1
push id19197
push userbmo:tchiovoloni@mozilla.com
push dateWed, 25 May 2016 18:25:46 +0000
reviewersasuth
bugs1228222
milestone49.0a1
Bug 1228222 Don't try to access ftp::/localhost to test "unknown server". r=asuth
dom/tests/unit/test_Fetch.js
--- a/dom/tests/unit/test_Fetch.js
+++ b/dom/tests/unit/test_Fetch.js
@@ -115,17 +115,17 @@ add_test(function test_GetData() {
   }).catch(function(e){
     do_report_unexpected_exception(e);
     do_test_finished();
     run_next_test();
   });
 });
 
 // test a GET with no init
-add_test(function test_GetData() {
+add_test(function test_GetDataNoInit() {
   do_test_pending();
 
   let testData = createTestData("/getData");
 
   server.registerPathHandler(testData.testPath, function(aRequest, aResponse) {
     try {
       // send a response
       writeDataToResponse(testData.response, aResponse);
@@ -198,17 +198,17 @@ add_test(function test_get50x() {
     run_next_test();
   });
 });
 
 // test a failure to connect
 add_test(function test_getTestFailedConnect() {
   do_test_pending();
   // try a server that's not there
-  fetch("ftp://localhost/should/fail").then(response => {
+  fetch("http://localhost:4/should/fail").then(response => {
     do_throw("Request should not succeed");
   }).catch(err => {
     do_check_eq(true, err instanceof TypeError);
     do_test_finished();
     run_next_test();
   });
 });
 
@@ -251,17 +251,17 @@ add_test(function test_PostJSONData() {
   }).catch(function(e) {
     do_report_unexpected_exception(e);
     do_test_finished();
     run_next_test();
   });
 });
 
 // test POSTing some text
-add_test(function test_PostJSONData() {
+add_test(function test_PostTextData() {
   do_test_pending();
 
   let testData = createTestData("/postTextData");
   testData.request.body = "A plain text body";
   testData.request.contentType = "text/plain";
   let responseHeaderName = "some-response-header";
   testData.response.headers[responseHeaderName] = "some header value";