Bug 1054411 - Cancel the HTTP requests in browser_keywordSearch.js to avoid making network contact. r=adw, a=test-only
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 15 Aug 2014 16:48:06 -0700
changeset 208313 6dec02f8d0ea
parent 208312 76f7c4f771f5
child 208314 8e09aad61a79
push id3819
push userryanvm@gmail.com
push date2014-08-16 14:16 +0000
treeherdermozilla-beta@8e09aad61a79 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, test-only
bugs1054411
milestone32.0
Bug 1054411 - Cancel the HTTP requests in browser_keywordSearch.js to avoid making network contact. r=adw, a=test-only
browser/base/content/test/general/browser_keywordSearch.js
--- a/browser/base/content/test/general/browser_keywordSearch.js
+++ b/browser/base/content/test/general/browser_keywordSearch.js
@@ -46,19 +46,21 @@ function test() {
         return;
 
       info("received document start");
 
       ok(req instanceof Ci.nsIChannel, "req is a channel");
       is(req.originalURI.spec, gCurrTest.searchURL, "search URL was loaded");
       info("Actual URI: " + req.URI.spec);
 
+      req.cancel(Components.results.NS_ERROR_FAILURE);
+
       executeSoon(nextTest);
     }
-  }
+  };
   gBrowser.addProgressListener(listener);
 
   registerCleanupFunction(function () {
     Services.ww.unregisterNotification(windowObserver);
 
     gBrowser.removeProgressListener(listener);
     gBrowser.removeTab(tab);
   });