Bug 1334909 - Wait for BookmarkingUI to have all pending statements complete before continuing with test. r=mak, a=test-only
authorJared Wein <jwein@mozilla.com>
Fri, 03 Feb 2017 15:03:06 -0500
changeset 376046 e382a8cc7883ef90ce352c74151440864484358b
parent 376045 ca9697c035cd267b723ba04315a61c7ae28efdb9
child 376047 208fb52894e92d98c8c459a5feb7de9b2a403246
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, test-only
bugs1334909
milestone53.0a2
Bug 1334909 - Wait for BookmarkingUI to have all pending statements complete before continuing with test. r=mak, a=test-only MozReview-Commit-ID: 1xMUm8aolOy
browser/base/content/test/general/browser_bookmark_popup.js
--- a/browser/base/content/test/general/browser_bookmark_popup.js
+++ b/browser/base/content/test/general/browser_bookmark_popup.js
@@ -21,16 +21,21 @@ function* test_bookmarks_popup({isNewBoo
       if (!isNewBookmark) {
         yield PlacesUtils.bookmarks.insert({
           parentGuid: PlacesUtils.bookmarks.unfiledGuid,
           url: "about:home",
           title: "Home Page"
         });
       }
 
+      info(`BookmarkingUI.status is ${BookmarkingUI.status}`);
+      yield BrowserTestUtils.waitForCondition(
+        () => BookmarkingUI.status != BookmarkingUI.STATUS_UPDATING,
+        "BookmarkingUI should not be updating");
+
       is(bookmarkStar.hasAttribute("starred"), !isNewBookmark,
          "Page should only be starred prior to popupshown if editing bookmark");
       is(bookmarkPanel.state, "closed", "Panel should be 'closed' to start test");
       let shownPromise = promisePopupShown(bookmarkPanel);
       yield popupShowFn(browser);
       yield shownPromise;
       is(bookmarkPanel.state, "open", "Panel should be 'open' after shownPromise is resolved");