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 209397 6dec02f8d0ea4d93a1963ddb057e15a0eadf43ac
parent 209396 76f7c4f771f5ebb8e9c597a2503a98db889f40f6
child 209398 8e09aad61a795eb77870893054c11c7b5dd1e410
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)
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);
   });