Backed out changeset b876444d90a6 (bug 1469036) for causing mochitest failures on test_console_serviceworker_cached.html and test_devtools_track_serviceworker_time.html a=backout
authorarthur.iakab <aiakab@mozilla.com>
Tue, 20 Nov 2018 10:18:02 +0200
changeset 503599 535a9477461a0ed42b2a8d5cc26fef87095443ea
parent 503598 74c27e915067b5afc43f4f64fd8fa2b0dc3bc81a
child 503600 c4da06f899d38f11d06ff72e624f57efb2e6750c
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1469036
milestone65.0a1
backs outb876444d90a674ae6a19311a495de483031f95c2
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
Backed out changeset b876444d90a6 (bug 1469036) for causing mochitest failures on test_console_serviceworker_cached.html and test_devtools_track_serviceworker_time.html a=backout
testing/mochitest/tests/Harness_sanity/mochitest.ini
testing/specialpowers/content/SpecialPowersObserver.jsm
testing/specialpowers/content/specialpowers.js
--- a/testing/mochitest/tests/Harness_sanity/mochitest.ini
+++ b/testing/mochitest/tests/Harness_sanity/mochitest.ini
@@ -5,19 +5,20 @@ skip-if = true #depends on fix for bug 1
 [test_importInMainProcess.html]
 skip-if = verify
 support-files = importtesting_chromescript.js
 [test_sanity.html]
 [test_sanityException.html]
 [test_sanityException2.html]
 [test_sanityParams.html]
 [test_sanityRegisteredServiceWorker.html]
+skip-if = serviceworker_e10s
 support-files = empty.js
 [test_sanityRegisteredServiceWorker2.html]
-skip-if = verify
+skip-if = verify || serviceworker_e10s
 support-files = empty.js
 [test_sanityWindowSnapshot.html]
 [test_SpecialPowersExtension.html]
 [test_SpecialPowersExtension2.html]
 support-files = file_SpecialPowersFrame1.html
 [test_SpecialPowersPushPermissions.html]
 support-files =
     specialPowers_framescript.js
--- a/testing/specialpowers/content/SpecialPowersObserver.jsm
+++ b/testing/specialpowers/content/SpecialPowersObserver.jsm
@@ -22,17 +22,16 @@ const CHILD_LOGGER_SCRIPT = "resource://
 
 // Glue to add in the observer API to this object.  This allows us to share code with chrome tests
 Services.scriptloader.loadSubScript("resource://specialpowers/SpecialPowersObserverAPI.js");
 
 /* XPCOM gunk */
 function SpecialPowersObserver() {
   this._isFrameScriptLoaded = false;
   this._messageManager = Services.mm;
-  this._serviceWorkerListener = null;
 }
 
 
 SpecialPowersObserver.prototype = new SpecialPowersObserverAPI();
 
 SpecialPowersObserver.prototype.QueryInterface = ChromeUtils.generateQI([Ci.nsIObserver]);
 
 SpecialPowersObserver.prototype.observe = function(aSubject, aTopic, aData) {
@@ -105,58 +104,28 @@ SpecialPowersObserver.prototype.init = f
   var manifestFile = Services.io.newFileURI(testsURI).
                        QueryInterface(Ci.nsIFileURL).file;
 
   Components.manager.QueryInterface(Ci.nsIComponentRegistrar).
                  autoRegister(manifestFile);
 
   obs.addObserver(this, "http-on-modify-request");
 
-  // We would like to check after each test that there are no left over
-  // ServiceWorkers still registered. However, because that check happens in
-  // the child process, we would have to do IPC after ever test to verify in
-  // the parent process (the source of truth for ServiceWorkers) that our
-  // invariants are correct. To avoid that, we send messages down to the
-  // children when to let them know when ServiceWorkers are registered or
-  // unregistered (and become idle!) to be able to quicky verify this.
-  // If this seems to be randomly failing, make sure that you're waiting for
-  // the unregister promise to resolve before calling SimpleTest.finish.
-  let swm = Cc["@mozilla.org/serviceworkers/manager;1"]
-              .getService(Ci.nsIServiceWorkerManager);
-  let self = this;
-  this._serviceWorkerListener = {
-    cnt: 0,
-    onRegister() {
-      this.cnt++;
-      self.onRegister(this.cnt);
-    },
-
-    onUnregister() {
-      this.cnt--;
-      self.onUnregister(this.cnt);
-    },
-  };
-  swm.addListener(this._serviceWorkerListener);
-
   this._loadFrameScript();
 };
 
 SpecialPowersObserver.prototype.uninit = function() {
   var obs = Services.obs;
   obs.removeObserver(this, "chrome-document-global-created");
   obs.removeObserver(this, "http-on-modify-request");
   this._registerObservers._topics.forEach((element) => {
     obs.removeObserver(this._registerObservers, element);
   });
   this._removeProcessCrashObservers();
 
-  let swm = Cc["@mozilla.org/serviceworkers/manager;1"]
-              .getService(Ci.nsIServiceWorkerManager);
-  swm.removeListener(this._serviceWorkerListener);
-
   if (this._isFrameScriptLoaded) {
     this._messageManager.removeMessageListener("SPPrefService", this);
     this._messageManager.removeMessageListener("SPProcessCrashManagerWait", this);
     this._messageManager.removeMessageListener("SPProcessCrashService", this);
     this._messageManager.removeMessageListener("SPPingService", this);
     this._messageManager.removeMessageListener("SpecialPowers.Quit", this);
     this._messageManager.removeMessageListener("SpecialPowers.Focus", this);
     this._messageManager.removeMessageListener("SpecialPowers.CreateFiles", this);
@@ -308,24 +277,8 @@ SpecialPowersObserver.prototype.receiveM
         this._createdFiles = null;
       }
       break;
     default:
       return this._receiveMessage(aMessage);
   }
   return undefined;
 };
-
-SpecialPowersObserver.prototype.onRegister = function(cnt) {
-  // Send a message for the transition from 0 => 1.
-  if (cnt === 1) {
-    this._sendAsyncMessage("SPServiceWorkerRegistered",
-      { registered: true });
-  }
-};
-
-SpecialPowersObserver.prototype.onUnregister = function(cnt) {
-  // Send a message for the transition from 1 => 0.
-  if (cnt === 0) {
-    this._sendAsyncMessage("SPServiceWorkerRegistered",
-      { registered: false });
-  }
-};
--- a/testing/specialpowers/content/specialpowers.js
+++ b/testing/specialpowers/content/specialpowers.js
@@ -20,17 +20,16 @@ Cu.forcePermissiveCOWs();
 function SpecialPowers(window, mm) {
   this.mm = mm;
 
   this.window = Cu.getWeakReference(window);
   this._windowID = window.windowUtils.currentInnerWindowID;
   this._encounteredCrashDumpFiles = [];
   this._unexpectedCrashDumpFiles = { };
   this._crashDumpDir = null;
-  this._serviceWorkerRegistered = false;
   this.DOMWindowUtils = bindDOMWindowUtils(window);
   Object.defineProperty(this, "Components", {
       configurable: true, enumerable: true, value: this.getFullComponents(),
   });
   this._pongHandlers = [];
   this._messageListener = this._messageReceived.bind(this);
   this._grandChildFrameMM = null;
   this._createFilesOnError = null;
@@ -53,17 +52,16 @@ function SpecialPowers(window, mm) {
                             "SPLoadExtension",
                             "SPProcessCrashManagerWait",
                             "SPStartupExtension",
                             "SPUnloadExtension",
                             "SPExtensionMessage",
                             "SPRequestDumpCoverageCounters",
                             "SPRequestResetCoverageCounters"];
   mm.addMessageListener("SPPingService", this._messageListener);
-  mm.addMessageListener("SPServiceWorkerRegistered", this._messageListener);
   mm.addMessageListener("SpecialPowers.FilesCreated", this._messageListener);
   mm.addMessageListener("SpecialPowers.FilesError", this._messageListener);
   let self = this;
   Services.obs.addObserver(function onInnerWindowDestroyed(subject, topic, data) {
     var id = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
     if (self._windowID === id) {
       Services.obs.removeObserver(onInnerWindowDestroyed, "inner-window-destroyed");
       try {
@@ -141,20 +139,16 @@ SpecialPowers.prototype._messageReceived
           handler();
         }
         if (this._grandChildFrameMM) {
           this._grandChildFrameMM.sendAsyncMessage("SPPingService", { op: "pong" });
         }
       }
       break;
 
-    case "SPServiceWorkerRegistered":
-      this._serviceWorkerRegistered = aMessage.data.registered;
-      break;
-
     case "SpecialPowers.FilesCreated":
       var createdHandler = this._createFilesOnSuccess;
       this._createFilesOnSuccess = null;
       this._createFilesOnError = null;
       if (createdHandler) {
         createdHandler(Cu.cloneInto(aMessage.data, this.mm.content));
       }
       break;
@@ -235,28 +229,19 @@ SpecialPowers.prototype.nestedFrameSetup
 
       let frameScript = "SpecialPowers.prototype.IsInNestedFrame=true;";
       mm.loadFrameScript("data:," + frameScript, false);
     }
   }, "remote-browser-shown");
 };
 
 SpecialPowers.prototype.isServiceWorkerRegistered = function() {
-  // For the time being, if parent_intercept is false, we can assume that
-  // ServiceWorkers registered by the current test are all known to the SWM in
-  // this process.
-  if (!Services.prefs.getBoolPref("dom.serviceWorkers.parent_intercept", false)) {
-    let swm = Cc["@mozilla.org/serviceworkers/manager;1"]
-                .getService(Ci.nsIServiceWorkerManager);
-    return swm.getAllRegistrations().length != 0;
-  }
-
-  // Please see the comment in SpecialPowersObserver.jsm above
-  // this._serviceWorkerListener's assignment for what this returns.
-  return this._serviceWorkerRegistered;
+  var swm = Cc["@mozilla.org/serviceworkers/manager;1"]
+              .getService(Ci.nsIServiceWorkerManager);
+  return swm.getAllRegistrations().length != 0;
 };
 
 // Attach our API to the window.
 function attachSpecialPowersToWindow(aWindow, mm) {
   try {
     if ((aWindow !== null) &&
         (aWindow !== undefined) &&
         (aWindow.wrappedJSObject) &&