Bug 995806 - test_DirectoryLinksProvider.js xpcshell test makes tcp connection to example.com [r=mcmanus]
authorMaxim Zhilyaev <mzhilyaev@mozilla.com>
Fri, 06 Jun 2014 11:02:55 -0700
changeset 207499 0d34e5a9ec24c26068c6fda9b2300f29f101aff1
parent 207498 c08592c634fce96ed3a76d4bcf7acaa663993874
child 207500 8dc8a55ea0592ea994414665ff67c15a9674d2f5
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs995806
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 995806 - test_DirectoryLinksProvider.js xpcshell test makes tcp connection to example.com [r=mcmanus] Point to localhost instead of nosuchhost for tests.
toolkit/modules/tests/xpcshell/test_DirectoryLinksProvider.js
--- a/toolkit/modules/tests/xpcshell/test_DirectoryLinksProvider.js
+++ b/toolkit/modules/tests/xpcshell/test_DirectoryLinksProvider.js
@@ -200,17 +200,17 @@ add_task(function test_fetchAndCacheLink
   // File should be empty.
   let data = yield readJsonFile();
   isIdentical(data, "");
 });
 
 add_task(function test_fetchAndCacheLinks_unknownHost() {
   yield DirectoryLinksProvider.init();
   yield cleanJsonFile();
-  let nonExistentServer = "http://nosuchhost";
+  let nonExistentServer = "http://nosuchhost.localhost";
   try {
     yield DirectoryLinksProvider._fetchAndCacheLinks(nonExistentServer);
     do_throw("BAD URIs should fail");
   } catch (e) {
     do_check_true(e.startsWith("Fetching " + nonExistentServer + " results in error code: "))
   }
 
   // File should be empty.
@@ -281,17 +281,17 @@ add_task(function test_DirectoryLinksPro
   let links = yield fetchData();
   do_check_eq(links.length, 1);
   let expectedData =  [{url: "http://example.com", title: "LocalSource", frecency: DIRECTORY_FRECENCY, lastVisitDate: 1, directoryIndex: 0}];
   isIdentical(links, expectedData);
 
   // tests these 2 things:
   // 1. _linksURL is properly set after the pref change
   // 2. invalid source url is correctly handled
-  let exampleUrl = 'http://nosuchhost/bad';
+  let exampleUrl = 'http://nosuchhost.localhost/bad';
   yield promiseDirectoryDownloadOnPrefChange(kSourceUrlPref, exampleUrl);
   do_check_eq(DirectoryLinksProvider._linksURL, exampleUrl);
 
   // since the download fail, the directory file must remain the same
   let newLinks = yield fetchData();
   isIdentical(newLinks, expectedData);
 
   // now remove the file, and re-download