Bug 1377598 - When testing the page action menu, wait for the bookmark to be removed before continuing to avoid issues when enabling async transactions. r?mak draft
authorMark Banner <standard8@mozilla.com>
Wed, 12 Jul 2017 11:42:31 +0100
changeset 607599 65d99ba66aeba948ddfb8b9e870a02eaede1d5d7
parent 607503 09a4282d1172ac255038e7ccacfd772140b219e2
child 637075 7952898fa2273ff5a2a828432f51becf1c3e42d3
push id68033
push userbmo:standard8@mozilla.com
push dateWed, 12 Jul 2017 14:05:28 +0000
reviewersmak
bugs1377598
milestone56.0a1
Bug 1377598 - When testing the page action menu, wait for the bookmark to be removed before continuing to avoid issues when enabling async transactions. r?mak MozReview-Commit-ID: JbjlxGarXPj
browser/base/content/test/urlbar/browser_page_action_menu.js
--- a/browser/base/content/test/urlbar/browser_page_action_menu.js
+++ b/browser/base/content/test/urlbar/browser_page_action_menu.js
@@ -53,16 +53,20 @@ add_task(async function bookmark() {
         return;
       }
       StarUI.panel.addEventListener("popupshown", resolve, { once: true });
     });
 
     // Click the remove-bookmark button in the panel.
     StarUI._element("editBookmarkPanelRemoveButton").click();
 
+    // Wait for the bookmark to be removed before continuing.
+    await PlacesTestUtils.waitForNotification("onItemRemoved",
+      (id, parentId, index, type, itemUrl) => url == itemUrl.spec);
+
     // Open the panel again.
     await promisePageActionPanelOpen();
 
     // The bookmark button should read "Bookmark This Page" and not be starred.
     Assert.equal(bookmarkButton.label, "Bookmark This Page");
     Assert.ok(!bookmarkButton.hasAttribute("starred"));
 
     // Done.