Adding mochitest tasks from head scripts turns out to cause unpredictable timing issues, where the initial add_task() call sometimes causes tests to begin running before the main test script has loaded, and had a chance to add its tasks. While I'd still prefer to do this initialization in a task, it's not worth the intermittent failures it causes. MozReview-Commit-ID: 3CDL82NyrzC
25 lines
708 B
JavaScript
25 lines
708 B
JavaScript
"use strict";
|
|
|
|
// We run tests under two different configurations, from mochitest.ini and
|
|
// mochitest-remote.ini. When running from mochitest-remote.ini, the tests are
|
|
// copied to the sub-directory "test-oop-extensions", which we detect here, and
|
|
// use to select our configuration.
|
|
if (location.pathname.includes("test-oop-extensions")) {
|
|
SpecialPowers.pushPrefEnv({set: [
|
|
["dom.ipc.processCount", 1],
|
|
["extensions.webextensions.remote", true],
|
|
]});
|
|
}
|
|
|
|
/* exported waitForLoad */
|
|
|
|
function waitForLoad(win) {
|
|
return new Promise(resolve => {
|
|
win.addEventListener("load", function listener() {
|
|
win.removeEventListener("load", listener, true);
|
|
resolve();
|
|
}, true);
|
|
});
|
|
}
|
|
|