Bug 1290980 - Fix intermittent e10s issue with oninstall. r=mconley
authorMarcos Caceres <marcos@marcosc.com>
Sun, 18 Sep 2016 21:28:00 -0400
changeset 314559 073e1d56b6cd3019082a3aef7ca4f399d2fc108b
parent 314558 8a9995559d5e817ce68b9911df3036aad2bb2143
child 314560 9a370db31b854832c7a67393be49d4c6c3fde3c6
push id81931
push userryanvm@gmail.com
push dateWed, 21 Sep 2016 01:49:11 +0000
treeherdermozilla-inbound@6fb622c938de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1290980
milestone52.0a1
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
Bug 1290980 - Fix intermittent e10s issue with oninstall. r=mconley
dom/manifest/test/browser_fire_install_event.js
--- a/dom/manifest/test/browser_fire_install_event.js
+++ b/dom/manifest/test/browser_fire_install_event.js
@@ -16,26 +16,28 @@ function enableOnInstallPref() {
   };
   return SpecialPowers.pushPrefEnv(ops);
 }
 
 // Send a message for the even to be fired.
 // This cause file_reg_install_event.html to be dynamically change.
 function* theTest(aBrowser) {
   aBrowser.allowEvents = true;
-  // Resolves when we get a custom event with the correct name
-  const responsePromise = new Promise((resolve) => {
-    aBrowser.contentDocument.addEventListener("dom.manifest.oninstall", resolve);
+  let waitForInstall = ContentTask.spawn(aBrowser, null, function*() {
+    yield ContentTaskUtils.waitForEvent(content.window, "install");
   });
-  const mm = aBrowser.messageManager;
-  const msgKey = "DOM:Manifest:FireInstallEvent";
-  const { data: { success } } = yield PromiseMessage.send(mm, msgKey);
+  const { data: { success } } = yield PromiseMessage
+    .send(aBrowser.messageManager, "DOM:Manifest:FireInstallEvent");
   ok(success, "message sent and received successfully.");
-  const { detail: { result } } = yield responsePromise;
-  ok(result, "the page sent us an acknowledgment as a custom event");
+  try {
+    yield waitForInstall;
+    ok(true, "Install event fired");
+  } catch (err) {
+    ok(false, "Install event didn't fire: " + err.message);
+  }
 }
 
 // Open a tab and run the test
 add_task(function*() {
   yield enableOnInstallPref();
   let tabOptions = {
     gBrowser: gBrowser,
     url: testURL.href,