Bug 1435048 - Wait for async UI update; r=ochameau

MozReview-Commit-ID: Co3WyAIzOLg

--HG--
extra : rebase_source : f162c0bce3bb0fe92bd3044036b7888bed799887
This commit is contained in:
Jan Odvarko 2018-02-09 17:29:30 +01:00
Родитель e24fc9efb3
Коммит d433394917
1 изменённых файлов: 13 добавлений и 5 удалений

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

@ -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);
}); });