зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1455796
- Make browser_messagemanager_loadprocessscript.js aware of OOP WebExtensions r=peterv
MozReview-Commit-ID: KENm9TmElUU --HG-- extra : rebase_source : 95cff7c06bf2220653a6df8fe9056932a9678739
This commit is contained in:
Родитель
b19c697041
Коммит
4cf2e3edb1
|
@ -1,10 +1,27 @@
|
|||
const BASE_NUMBER_OF_PROCESSES = 3;
|
||||
function getBaseNumberOfProcesses() {
|
||||
// We should have three processes for this test, the parent process and two
|
||||
// content processes for the tabs craeted by this test.
|
||||
let processCount = 3;
|
||||
|
||||
// If we run WebExtensions out-of-process (see bug 1190679), there might be
|
||||
// additional processes for those, so let's add these to the base count to
|
||||
// not have system WebExtensions cause test failures.
|
||||
for (let i = 0; i < Services.ppmm.childCount; i++) {
|
||||
if (Services.ppmm.getChildAt(i).remoteType === E10SUtils.EXTENSION_REMOTE_TYPE) {
|
||||
processCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return processCount;
|
||||
}
|
||||
|
||||
function checkBaseProcessCount(description) {
|
||||
const baseProcessCount = getBaseNumberOfProcesses();
|
||||
const {childCount} = Services.ppmm;
|
||||
// With preloaded activity-stream, process count is a bit undeterministic, so
|
||||
// allow for some variation
|
||||
const extraCount = BASE_NUMBER_OF_PROCESSES + 1;
|
||||
ok(childCount === BASE_NUMBER_OF_PROCESSES || childCount === extraCount, `${description} (${BASE_NUMBER_OF_PROCESSES} or ${extraCount})`);
|
||||
const extraCount = baseProcessCount + 1;
|
||||
ok(childCount === baseProcessCount || childCount === extraCount, `${description} (${baseProcessCount} or ${extraCount})`);
|
||||
}
|
||||
|
||||
function processScript() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче