зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1435048 - Wait for async UI update; r=ochameau
MozReview-Commit-ID: Co3WyAIzOLg --HG-- extra : rebase_source : f162c0bce3bb0fe92bd3044036b7888bed799887
This commit is contained in:
Родитель
e24fc9efb3
Коммит
d433394917
|
@ -34,11 +34,19 @@ add_task(async () => {
|
||||||
ok(onContentLoad, "There must be DOMContentLoaded label");
|
ok(onContentLoad, "There must be DOMContentLoaded label");
|
||||||
ok(onLoad, "There must be load label");
|
ok(onLoad, "There must be load label");
|
||||||
|
|
||||||
// The content should not be empty
|
// The content should not be empty. The UI update can also be async,
|
||||||
ok(requestCount.textContent, "There must be request count label text");
|
// so use waitUntil.
|
||||||
ok(size.textContent, "There must be size label text");
|
await waitUntil(() => requestCount.textContent);
|
||||||
ok(onContentLoad.textContent, "There must be DOMContentLoaded label text");
|
ok(true, "There must be request count label text");
|
||||||
ok(onLoad.textContent, "There must be load label text");
|
|
||||||
|
await waitUntil(() => size.textContent);
|
||||||
|
ok(true, "There must be size label text");
|
||||||
|
|
||||||
|
await waitUntil(() => onContentLoad.textContent);
|
||||||
|
ok(true, "There must be DOMContentLoaded label text");
|
||||||
|
|
||||||
|
await waitUntil(() => onLoad.textContent);
|
||||||
|
ok(true, "There must be load label text");
|
||||||
|
|
||||||
return teardown(monitor);
|
return teardown(monitor);
|
||||||
});
|
});
|
||||||
|
|
Загрузка…
Ссылка в новой задаче