Bug 1529867 - Wait for worker source, r=jlast.

Differential Revision: https://phabricator.services.mozilla.com/D25612

--HG--
extra : rebase_source : 940a415ade4c80a9fa884375749e2f4c9cc2cbf0
This commit is contained in:
Brian Hackett 2019-04-01 07:48:39 -06:00
Родитель 6b19864a52
Коммит 33ca510058
2 изменённых файлов: 3 добавлений и 4 удалений

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

@ -43,6 +43,8 @@ add_task(async function() {
const worker2Thread = workers[1].actor; const worker2Thread = workers[1].actor;
const mainThreadSource = findSource(dbg, "doc-windowless-workers.html"); const mainThreadSource = findSource(dbg, "doc-windowless-workers.html");
await waitForSource(dbg, "simple-worker.js");
const workerSource = findSource(dbg, "simple-worker.js"); const workerSource = findSource(dbg, "simple-worker.js");
info("Test pausing in the main thread"); info("Test pausing in the main thread");

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

@ -192,10 +192,7 @@ async function waitForSources(dbg, ...sources) {
function waitForSource(dbg, url) { function waitForSource(dbg, url) {
return waitForState( return waitForState(
dbg, dbg,
state => { state => findSource(dbg, url, { silent: true }),
const sources = dbg.selectors.getSources(state);
return Object.values(sources).find(s => (s.url || "").includes(url));
},
"source exists" "source exists"
); );
} }