From d43339491730f4b3334d9a781ad16bf72bed30e0 Mon Sep 17 00:00:00 2001 From: Jan Odvarko Date: Fri, 9 Feb 2018 17:29:30 +0100 Subject: [PATCH] Bug 1435048 - Wait for async UI update; r=ochameau MozReview-Commit-ID: Co3WyAIzOLg --HG-- extra : rebase_source : f162c0bce3bb0fe92bd3044036b7888bed799887 --- .../netmonitor/test/browser_net_status-bar.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/devtools/client/netmonitor/test/browser_net_status-bar.js b/devtools/client/netmonitor/test/browser_net_status-bar.js index 6250e8232ebd..3574f4ecc2e9 100644 --- a/devtools/client/netmonitor/test/browser_net_status-bar.js +++ b/devtools/client/netmonitor/test/browser_net_status-bar.js @@ -34,11 +34,19 @@ add_task(async () => { ok(onContentLoad, "There must be DOMContentLoaded label"); ok(onLoad, "There must be load label"); - // The content should not be empty - ok(requestCount.textContent, "There must be request count label text"); - ok(size.textContent, "There must be size label text"); - ok(onContentLoad.textContent, "There must be DOMContentLoaded label text"); - ok(onLoad.textContent, "There must be load label text"); + // The content should not be empty. The UI update can also be async, + // so use waitUntil. + await waitUntil(() => requestCount.textContent); + ok(true, "There must be request count 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); });