Bug 1598205 - Fix browser_webconsole_filter_navigation_marker intermittent. r=Honza.
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Tue, 10 Dec 2019 14:22:52 +0000
changeset 506242 a7e7d853181688ac74f85de38745bfe0156dc222
parent 506241 d2148a8a997f0653ff9c189073a7874eed2d18ba
child 506243 11201ca538255fc2a4afb43b1164081f624f89e7
push id36901
push useraciure@mozilla.com
push dateTue, 10 Dec 2019 21:29:05 +0000
treeherdermozilla-central@1fb1ca98f23b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1598205
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1598205 - Fix browser_webconsole_filter_navigation_marker intermittent. r=Honza. Differential Revision: https://phabricator.services.mozilla.com/D56539
devtools/client/webconsole/test/browser/browser_webconsole_filter_navigation_marker.js
--- a/devtools/client/webconsole/test/browser/browser_webconsole_filter_navigation_marker.js
+++ b/devtools/client/webconsole/test/browser/browser_webconsole_filter_navigation_marker.js
@@ -9,35 +9,49 @@ const TEST_URI = `data:text/html;charset
   <p>Web Console test for navigation marker filtering.</p>
   <script>console.log("hello " + "world");</script>`;
 
 add_task(async function() {
   // Enable persist log
   await pushPref("devtools.webconsole.persistlog", true);
 
   const hud = await openNewTabAndConsole(TEST_URI);
-  await waitFor(() => findMessage(hud, "hello world"));
+  await waitFor(
+    () => findMessage(hud, "hello world"),
+    "Wait for log message to be rendered"
+  );
+  ok(true, "Log message rendered");
 
   info("Reload the page");
-  const onInitMessage = waitForMessage(hud, "hello world");
   ContentTask.spawn(gBrowser.selectedBrowser, null, () => {
     content.location.reload();
   });
-  await onInitMessage;
 
   // Wait for the navigation message to be displayed.
-  await waitFor(() => findMessage(hud, "Navigated to"));
+  await waitFor(
+    () => findMessage(hud, "Navigated to"),
+    "Wait for navigation message to be rendered"
+  );
+
+  // Wait for 2 hellow world messages to be displayed.
+  await waitFor(
+    () => findMessages(hud, "hello world").length == 2,
+    "Wait for log message to be rendered after navigation"
+  );
 
   info("disable all filters and set a text filter that doesn't match anything");
   await setFilterState(hud, {
     error: false,
     warn: false,
     log: false,
     info: false,
     text: "qwqwqwqwqwqw",
   });
 
-  await waitFor(() => !findMessage(hud, "hello world"));
+  await waitFor(
+    () => !findMessage(hud, "hello world"),
+    "Wait for the log messages to be hidden"
+  );
   ok(
     findMessage(hud, "Navigated to"),
     "The navigation marker is still visible"
   );
 });