Bug 1425897 - Fix race condition in about:debugging test helper;r=baku

MozReview-Commit-ID: ELvxWzld9Um

--HG--
extra : rebase_source : b83e790b6e559374be302b6654b39ac1d8ab5271
This commit is contained in:
Julian Descottes 2017-12-20 19:40:49 +01:00
Родитель 30d3307a79
Коммит fa4273ed80
1 изменённых файлов: 14 добавлений и 11 удалений

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

@ -401,19 +401,22 @@ function* waitForServiceWorkerActivation(swUrl, document) {
/**
* Set all preferences needed to enable service worker debugging and testing.
*/
function enableServiceWorkerDebugging() {
return new Promise(done => {
let options = { "set": [
// Enable service workers.
["dom.serviceWorkers.enabled", true],
// Accept workers from mochitest's http.
["dom.serviceWorkers.testing.enabled", true],
// Force single content process.
["dom.ipc.processCount", 1],
]};
function* enableServiceWorkerDebugging() {
let options = { "set": [
// Enable service workers.
["dom.serviceWorkers.enabled", true],
// Accept workers from mochitest's http.
["dom.serviceWorkers.testing.enabled", true],
// Force single content process.
["dom.ipc.processCount", 1],
]};
// Wait for dom.ipc.processCount to be updated before releasing processes.
yield new Promise(done => {
SpecialPowers.pushPrefEnv(options, done);
Services.ppmm.releaseCachedProcesses();
});
Services.ppmm.releaseCachedProcesses();
}
/**