Bug 1622247 Replace BrowserTestUtils.waitForCondition with TestUtils.waitForCondition in browser_page_action_menu.js r=prathiksha
authormeenohara <meenohara@gmail.com>
Mon, 16 Mar 2020 10:58:54 +0000
changeset 518941 f907ea297879f34c0c918606736bff5b7ce6e2f1
parent 518940 2dd539f44d877396e51b98d3e2136a0474316e98
child 518942 924333ef37b8ac0f1cb70ff8236f3987d72e5600
push id110201
push userprathikshaprasadsuman@gmail.com
push dateMon, 16 Mar 2020 11:00:15 +0000
treeherderautoland@f907ea297879 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersprathiksha
bugs1622247
milestone76.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 1622247 Replace BrowserTestUtils.waitForCondition with TestUtils.waitForCondition in browser_page_action_menu.js r=prathiksha Differential Revision: https://phabricator.services.mozilla.com/D66863
browser/base/content/test/pageActions/browser_page_action_menu.js
--- a/browser/base/content/test/pageActions/browser_page_action_menu.js
+++ b/browser/base/content/test/pageActions/browser_page_action_menu.js
@@ -158,24 +158,24 @@ add_task(async function pinTabFromURLBar
     // Add action to URL bar.
     let action = PageActions._builtInActions.find(a => a.id == "pinTab");
     action.pinnedToUrlbar = true;
     registerCleanupFunction(() => (action.pinnedToUrlbar = false));
 
     // Click the Pin Tab button.
     let pinTabButton = document.getElementById("pageAction-urlbar-pinTab");
     EventUtils.synthesizeMouseAtCenter(pinTabButton, {});
-    await BrowserTestUtils.waitForCondition(
+    await TestUtils.waitForCondition(
       () => gBrowser.selectedTab.pinned,
       "Tab was pinned"
     );
 
     // Click the Unpin Tab button
     EventUtils.synthesizeMouseAtCenter(pinTabButton, {});
-    await BrowserTestUtils.waitForCondition(
+    await TestUtils.waitForCondition(
       () => !gBrowser.selectedTab.pinned,
       "Tab was unpinned"
     );
   });
 });
 
 add_task(async function emailLink() {
   // Open an actionable page so that the main page action button appears.  (It
@@ -971,17 +971,17 @@ add_task(async function sendToDevice_inU
       BrowserPageActions._panelViewNodeIDForActionID("sendToDevice", true) +
       "-body";
     let body = document.getElementById(bodyID);
     let deviceMenuItem = body.querySelector(".sendtab-target");
     Assert.notEqual(deviceMenuItem, null);
 
     // For good measure, wait until it's visible.
     let dwu = window.windowUtils;
-    await BrowserTestUtils.waitForCondition(() => {
+    await TestUtils.waitForCondition(() => {
       let bounds = dwu.getBoundsWithoutFlushing(deviceMenuItem);
       return bounds.height > 0 && bounds.width > 0;
     }, "Waiting for first device menu item to appear");
 
     // Click it, which should cause the panel to close.
     let hiddenPromise = promisePanelHidden(
       BrowserPageActions._activatedActionPanelID
     );
@@ -1032,17 +1032,17 @@ add_task(async function contextMenu() {
     );
     contextMenuPromise = promisePanelHidden("pageActionContextMenu");
     EventUtils.synthesizeMouseAtCenter(menuItems[0], {});
     await contextMenuPromise;
 
     // The action should be removed from the urlbar.  In this case, the bookmark
     // star, the node in the urlbar should be hidden.
     let starButtonBox = document.getElementById("star-button-box");
-    await BrowserTestUtils.waitForCondition(() => {
+    await TestUtils.waitForCondition(() => {
       return starButtonBox.hidden;
     }, "Waiting for star button to become hidden");
 
     // Open the context menu again on the bookmark button.  (The page action
     // panel remains open.)
     contextMenuPromise = promisePanelShown("pageActionContextMenu");
     EventUtils.synthesizeMouseAtCenter(bookmarkButton, {
       type: "contextmenu",
@@ -1058,17 +1058,17 @@ add_task(async function contextMenu() {
       "Add to Address Bar",
       "Context menu is in the 'add' state"
     );
     contextMenuPromise = promisePanelHidden("pageActionContextMenu");
     EventUtils.synthesizeMouseAtCenter(menuItems[0], {});
     await contextMenuPromise;
 
     // The action should be added to the urlbar.
-    await BrowserTestUtils.waitForCondition(() => {
+    await TestUtils.waitForCondition(() => {
       return !starButtonBox.hidden;
     }, "Waiting for star button to become unhidden");
 
     // Open the context menu on the bookmark star in the urlbar.
     contextMenuPromise = promisePanelShown("pageActionContextMenu");
     EventUtils.synthesizeMouseAtCenter(starButtonBox, {
       type: "contextmenu",
       button: 2,
@@ -1083,17 +1083,17 @@ add_task(async function contextMenu() {
       "Remove from Address Bar",
       "Context menu is in the 'remove' state"
     );
     contextMenuPromise = promisePanelHidden("pageActionContextMenu");
     EventUtils.synthesizeMouseAtCenter(menuItems[0], {});
     await contextMenuPromise;
 
     // The action should be removed from the urlbar.
-    await BrowserTestUtils.waitForCondition(() => {
+    await TestUtils.waitForCondition(() => {
       return starButtonBox.hidden;
     }, "Waiting for star button to become hidden");
 
     // Finally, add the bookmark star back to the urlbar so that other tests
     // that rely on it are OK.
     await promisePageActionPanelOpen();
     contextMenuPromise = promisePanelShown("pageActionContextMenu");
     EventUtils.synthesizeMouseAtCenter(bookmarkButton, {
@@ -1107,17 +1107,17 @@ add_task(async function contextMenu() {
     Assert.equal(
       menuItems[0].label,
       "Add to Address Bar",
       "Context menu is in the 'add' state"
     );
     contextMenuPromise = promisePanelHidden("pageActionContextMenu");
     EventUtils.synthesizeMouseAtCenter(menuItems[0], {});
     await contextMenuPromise;
-    await BrowserTestUtils.waitForCondition(() => {
+    await TestUtils.waitForCondition(() => {
       return !starButtonBox.hidden;
     }, "Waiting for star button to become unhidden");
   });
 
   // urlbar tests that run after this one can break if the mouse is left over
   // the area where the urlbar popup appears, which seems to happen due to the
   // above synthesized mouse events.  Move it over the urlbar.
   EventUtils.synthesizeMouseAtCenter(gURLBar.textbox, { type: "mousemove" });