Bug 1443470 - Fix race when hovering status column in browser_net_filter-flags.js. r=Honza
authorAlexandre Poirot <poirot.alex@gmail.com>
Sun, 25 Feb 2018 11:22:01 -0800
changeset 462064 1040f6405dd9fe7d463bf5f8704c289903367fa9
parent 462063 c1bfcc7294c5249450d0bb7a4e3c2b361a368763
child 462065 e1683e068e9415f1f002931934b2530172dff2d4
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1443470
milestone60.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 1443470 - Fix race when hovering status column in browser_net_filter-flags.js. r=Honza MozReview-Commit-ID: NlcqpQLjLN
devtools/client/netmonitor/test/browser_net_filter-flags.js
--- a/devtools/client/netmonitor/test/browser_net_filter-flags.js
+++ b/devtools/client/netmonitor/test/browser_net_filter-flags.js
@@ -351,24 +351,16 @@ add_task(async function () {
 
   // Test mixing flags
   setFreetextFilter("-mime-type:HtmL status-code:200");
   await testContents([0, 0, 1, 1, 1, 1, 1, 1, 1, 0]);
 
   await teardown(monitor);
 
   async function testContents(visibility) {
-    let requestItems = document.querySelectorAll(".request-list-item");
-    for (let requestItem of requestItems) {
-      requestItem.scrollIntoView();
-      let requestsListStatus = requestItem.querySelector(".requests-list-status");
-      EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
-      await waitUntil(() => requestsListStatus.title);
-    }
-
     let items = getSortedRequests(store.getState());
     let visibleItems = getDisplayedRequests(store.getState());
 
     // Filter results will be updated asynchronously, so we should wait until
     // displayed requests reach final state.
     await waitUntil(() => {
       visibleItems = getDisplayedRequests(store.getState());
       return visibleItems.size === visibility.filter(e => e).length;
@@ -389,16 +381,29 @@ add_task(async function () {
       await waitUntil(() => {
         visibleItems = getDisplayedRequests(store.getState());
         isThere = visibleItems.some(r => r.id == itemId);
         return isThere === shouldBeVisible;
       });
 
       is(isThere, shouldBeVisible,
         `The item at index ${i} has visibility=${shouldBeVisible}`);
+    }
+
+    // Fake mouse over the status column only after the list is fully updated
+    let requestItems = document.querySelectorAll(".request-list-item");
+    for (let requestItem of requestItems) {
+      requestItem.scrollIntoView();
+      let requestsListStatus = requestItem.querySelector(".requests-list-status");
+      EventUtils.sendMouseEvent({ type: "mouseover" }, requestsListStatus);
+      await waitUntil(() => requestsListStatus.title);
+    }
+
+    for (let i = 0; i < visibility.length; i++) {
+      let shouldBeVisible = !!visibility[i];
 
       if (shouldBeVisible) {
         let { method, url, data } = EXPECTED_REQUESTS[i];
         verifyRequestItemTarget(
           document,
           getDisplayedRequests(store.getState()),
           getSortedRequests(store.getState()).get(i),
           method,