Bug 1271374 - Cache-bust page URL. r=me, a=test-only
authorKris Maglione <maglione.k@gmail.com>
Tue, 23 Aug 2016 18:00:58 -0700
changeset 340458 7d88d38c38d14727a6c8779aa3d0ebe20f88ec66
parent 340457 a37eba7b5746020ab905019788fe46c7c8548e23
child 340459 81ee9fcb5069fc3a6afec16db9c6086e31eef260
push id6341
push userryanvm@gmail.com
push dateThu, 25 Aug 2016 13:56:29 +0000
treeherdermozilla-beta@98849c50bd6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, test-only
bugs1271374
milestone49.0
Bug 1271374 - Cache-bust page URL. r=me, a=test-only MozReview-Commit-ID: FAdxwoxRLMA
browser/components/extensions/test/browser/browser_ext_tabs_executeScript_runAt.js
--- a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_runAt.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_runAt.js
@@ -26,28 +26,30 @@ add_task(function* testExecuteScript() {
     const MAX_TRIES = 10;
     let tries = 0;
 
     function again() {
       if (tries++ == MAX_TRIES) {
         return Promise.reject(new Error("Max tries exceeded"));
       }
 
+      let url = `${URL}?r=${Math.random()}`;
+
       let loadingPromise = new Promise(resolve => {
         browser.tabs.onUpdated.addListener(function listener(tabId, changed, tab_) {
-          if (tabId == tab.id && changed.status == "loading" && tab_.url == URL) {
+          if (tabId == tab.id && changed.status == "loading" && tab_.url == url) {
             browser.tabs.onUpdated.removeListener(listener);
             resolve();
           }
         });
       });
 
       // TODO: Test allFrames and frameId.
 
-      return browser.tabs.update({url: URL}).then(() => {
+      return browser.tabs.update({url}).then(() => {
         return loadingPromise;
       }).then(() => {
         return Promise.all([
           // Send the executeScript requests in the reverse order that we expect
           // them to execute in, to avoid them passing only because of timing
           // races.
           browser.tabs.executeScript({
             code: "document.readyState",