Bug 1344089: Fix test_ext_webrequest_filter Android failures on infra. r=mixedpuppy
authorKris Maglione <maglione.k@gmail.com>
Thu, 02 Mar 2017 19:10:54 -0800
changeset 374921 34ec74d66e98d041f280e14bdcf2047ad7a1e366
parent 374920 2ae803be2c45d9942ec6f4ab0a780a1bfaf49b2a
child 374922 a9869c35855329f1a23fb8d7ac13d76261224a01
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmixedpuppy
bugs1344089
milestone54.0a1
Bug 1344089: Fix test_ext_webrequest_filter Android failures on infra. r=mixedpuppy MozReview-Commit-ID: 6WAeiOE03Uk
toolkit/components/extensions/test/mochitest/test_ext_webrequest_filter.html
--- a/toolkit/components/extensions/test/mochitest/test_ext_webrequest_filter.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_webrequest_filter.html
@@ -100,16 +100,18 @@ add_task(function* test_webRequest_filte
   yield extension.unload();
 });
 
 add_task(function* test_webRequest_filter_tab() {
   yield SpecialPowers.pushPrefEnv({
     set: [["dom.serviceWorkers.testing.enabled", true]],
   });
 
+  let img = `file_image_good.png?r=${Math.random()}`;
+
   let events = {
     "onBeforeRequest":     [{urls: ["<all_urls>"], tabId: windowData.tabId}],
     "onBeforeSendHeaders": [{urls: ["<all_urls>"], tabId: windowData.tabId}, ["requestHeaders"]],
     "onSendHeaders":       [{urls: ["<all_urls>"], tabId: windowData.tabId}, ["requestHeaders"]],
     "onBeforeRedirect":    [{urls: ["<all_urls>"], tabId: windowData.tabId}],
     "onHeadersReceived":   [{urls: ["<all_urls>"], tabId: windowData.tabId}, ["responseHeaders"]],
     "onResponseStarted":   [{urls: ["<all_urls>"], tabId: windowData.tabId}],
     "onCompleted":         [{urls: ["<all_urls>"], tabId: windowData.tabId}, ["responseHeaders"]],
@@ -125,26 +127,26 @@ add_task(function* test_webRequest_filte
 
   let extension = makeExtension(events);
   yield extension.startup();
   extension.sendMessage("set-expected", {expect, origin: location.href});
   yield extension.awaitMessage("continue");
 
   if (AppConstants.MOZ_BUILD_APP === "browser") {
     // We should not get events for a new window load.
-    let newWindow = window.open("file_image_good.png", "_blank", "width=100,height=100");
+    let newWindow = window.open(img, "_blank", "width=100,height=100");
     yield waitForLoad(newWindow);
     newWindow.close();
   }
 
   // We should not get background events.
   let registration = yield navigator.serviceWorker.register("webrequest_worker.js?test1", {scope: "."});
 
   // We should get events for the reload.
-  testWindow.location = "file_image_good.png";
+  testWindow.location = img;
   yield extension.awaitMessage("done");
 
   yield registration.unregister();
   yield extension.unload();
 });
 
 
 add_task(function* test_webRequest_filter_background() {