Backed out changeset e12dcb4be855 (bug 1358914) for timing out in toolkit/components/extensions/test/mochitest/test_chrome_ext_hybrid_addons.html. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 15 May 2017 23:47:30 +0200
changeset 358534 7a2841383525164d5651218a06f3b5e74bd570af
parent 358533 ba0f4d2877263ffea0f71f5311ae8c780606b0fc
child 358535 c24d57d10d7153e900afb1f756927311ba93ddf5
push id90352
push usercbook@mozilla.com
push dateTue, 16 May 2017 13:09:14 +0000
treeherdermozilla-inbound@8f89d291e303 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1358914
milestone55.0a1
backs oute12dcb4be8551c14073c891a4c9f790e0d790215
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 e12dcb4be855 (bug 1358914) for timing out in toolkit/components/extensions/test/mochitest/test_chrome_ext_hybrid_addons.html. r=backout
toolkit/mozapps/extensions/internal/XPIProvider.jsm
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -5212,17 +5212,25 @@ this.XPIProvider = {
       // Add other stuff that extensions want.
       Object.assign(activeAddon.bootstrapScope, {Worker, ChromeWorker});
 
       // Define a console for the add-on
       XPCOMUtils.defineLazyGetter(
         activeAddon.bootstrapScope, "console",
         () => new ConsoleAPI({ consoleID: "addon/" + aId }));
 
-      Services.scriptloader.loadSubScript(uri, activeAddon.bootstrapScope);
+      // As we don't want our caller to control the JS version used for the
+      // bootstrap file, we run loadSubScript within the context of the
+      // sandbox with the latest JS version set explicitly.
+      activeAddon.bootstrapScope.__SCRIPT_URI_SPEC__ = uri;
+      Components.utils.evalInSandbox(
+        "Components.classes['@mozilla.org/moz/jssubscript-loader;1'] \
+                   .getService(Components.interfaces.mozIJSSubScriptLoader) \
+                   .loadSubScript(__SCRIPT_URI_SPEC__);",
+                   activeAddon.bootstrapScope, "ECMAv5");
     } catch (e) {
       logger.warn("Error loading bootstrap.js for " + aId, e);
     }
 
     // Only access BrowserToolboxProcess if ToolboxProcess.jsm has been
     // initialized as otherwise, when it will be initialized, all addons'
     // globals will be added anyways
     if (this._toolboxProcessLoaded) {
@@ -5304,18 +5312,18 @@ this.XPIProvider = {
       }
 
       // Nothing to call for locales
       if (aAddon.type == "locale")
         return;
 
       let method = undefined;
       try {
-        let scope = activeAddon.bootstrapScope;
-        method = scope[aMethod] || Cu.evalInSandbox(`${aMethod};`, scope);
+        method = Components.utils.evalInSandbox(`${aMethod};`,
+          activeAddon.bootstrapScope, "ECMAv5");
       } catch (e) {
         // An exception will be caught if the expected method is not defined.
         // That will be logged below.
       }
 
       // Extensions are automatically deinitialized in the correct order at shutdown.
       if (aMethod == "shutdown" && aReason != BOOTSTRAP_REASONS.APP_SHUTDOWN) {
         activeAddon.disable = true;