Backed out changeset e12dcb4be855 (bug 1358914) for timing out in toolkit/components/extensions/test/mochitest/test_chrome_ext_hybrid_addons.html. r=backout

This commit is contained in:
Sebastian Hengst 2017-05-15 23:47:30 +02:00
Родитель 96dc842167
Коммит d8ceb0f94f
1 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -5217,7 +5217,15 @@ this.XPIProvider = {
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);
}
@ -5309,8 +5317,8 @@ this.XPIProvider = {
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.