Bug 1254312 - [e10s] Fix browser_plugin_enabled_state_locked.js to run in e10s. r=mconley, a=test-only
authorJared Wein <jwein@mozilla.com>
Mon, 07 Mar 2016 17:31:14 -0500
changeset 323370 c63a2db7aafa18f7a5374c2bd431f5fbf0274361
parent 323369 66c7e14adba69fd75d1024f2cb93286360a20c9b
child 323371 ecdc38c5ea399fcc91b001f4d104ba61bcf540a2
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, test-only
bugs1254312
milestone47.0a2
Bug 1254312 - [e10s] Fix browser_plugin_enabled_state_locked.js to run in e10s. r=mconley, a=test-only MozReview-Commit-ID: 4FDbMuNCbfV
toolkit/mozapps/extensions/test/browser/browser-common.ini
toolkit/mozapps/extensions/test/browser/browser_plugin_enabled_state_locked.js
--- a/toolkit/mozapps/extensions/test/browser/browser-common.ini
+++ b/toolkit/mozapps/extensions/test/browser/browser-common.ini
@@ -42,17 +42,16 @@ skip-if = buildapp == 'mulet'
 [browser_experiments.js]
 skip-if = e10s
 [browser_list.js]
 [browser_metadataTimeout.js]
 [browser_searching.js]
 [browser_sorting.js]
 [browser_sorting_plugins.js]
 [browser_plugin_enabled_state_locked.js]
-skip-if = e10s # TypeError: Promise.defer is not a function
 [browser_uninstalling.js]
 [browser_install.js]
 [browser_recentupdates.js]
 [browser_manualupdates.js]
 [browser_globalwarnings.js]
 [browser_globalinformations.js]
 [browser_eula.js]
 skip-if = buildapp == 'mulet'
--- a/toolkit/mozapps/extensions/test/browser/browser_plugin_enabled_state_locked.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_plugin_enabled_state_locked.js
@@ -25,19 +25,19 @@ function getTestPluginPref() {
 }
 
 registerCleanupFunction(() => {
   Services.prefs.unlockPref(getTestPluginPref());
   Services.prefs.clearUserPref(getTestPluginPref());
 });
 
 function getPlugins() {
-  let deferred = Promise.defer();
-  AddonManager.getAddonsByTypes(["plugin"], plugins => deferred.resolve(plugins));
-  return deferred.promise;
+  return new Promise(resolve => {
+    AddonManager.getAddonsByTypes(["plugin"], plugins => resolve(plugins));
+  });
 }
 
 function getTestPlugin(aPlugins) {
   let testPluginId;
 
   for (let plugin of aPlugins) {
     if (plugin.name == "Test Plug-in") {
       testPluginId = plugin.id;
@@ -71,25 +71,25 @@ function checkStateMenuDetail(locked) {
   Assert.equal(Services.prefs.prefIsLocked(getTestPluginPref()), locked,
     "Preference should be " + (locked === true ? "" : "un") + "locked.");
 
   // open details menu
   let details = gManagerWindow.document.getAnonymousElementByAttribute(gPluginElement, "anonid", "details-btn");
   is_element_visible(details, "Details link should be visible.");
   EventUtils.synthesizeMouseAtCenter(details, {}, gManagerWindow);
 
-  let deferred = Promise.defer();
-  wait_for_view_load(gManagerWindow, function() {
-    let menuList = gManagerWindow.document.getElementById("detail-state-menulist");
-    is_element_visible(menuList, "Details state menu should be visible.");
-    Assert.equal(menuList.disabled, locked,
-      "Details state menu enabled state should be correct.");
-    deferred.resolve();
+  return new Promise(resolve => {
+    wait_for_view_load(gManagerWindow, function() {
+      let menuList = gManagerWindow.document.getElementById("detail-state-menulist");
+      is_element_visible(menuList, "Details state menu should be visible.");
+      Assert.equal(menuList.disabled, locked,
+        "Details state menu enabled state should be correct.");
+      resolve();
+    });
   });
-  return deferred.promise;
 }
 
 add_task(function* initializeState() {
   Services.prefs.setIntPref(getTestPluginPref(), Ci.nsIPluginTag.STATE_ENABLED);
   Services.prefs.unlockPref(getTestPluginPref());
   gManagerWindow = yield open_manager();
   gCategoryUtilities = new CategoryUtilities(gManagerWindow);
   yield gCategoryUtilities.openType("plugin");