Bug 1530781 - Replaced waitForCondition in browser_901207_searchbar_in_panel.js with TestUtils.waitForCondition. r=johannh
authormeghaaa <None>
Thu, 15 Aug 2019 11:57:38 +0300
changeset 488154 b260fa5b5fb287e5db5870614cc60713c35825be
parent 488153 0db07ff50ab5c9b655ba7e23788f68a2b9d66e71
child 488155 811288577b9bcb1c6ae511ffee2a2a0d38508acc
push id113901
push usermalexandru@mozilla.com
push dateThu, 15 Aug 2019 11:07:50 +0000
treeherdermozilla-inbound@b260fa5b5fb2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1530781
milestone70.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 1530781 - Replaced waitForCondition in browser_901207_searchbar_in_panel.js with TestUtils.waitForCondition. r=johannh Differential Revision: https://phabricator.services.mozilla.com//D42085
browser/components/customizableui/test/browser_901207_searchbar_in_panel.js
--- a/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js
+++ b/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 logActiveElement();
 
 async function waitForSearchBarFocus() {
   let searchbar = document.getElementById("searchbar");
-  await waitForCondition(function() {
+  await TestUtils.waitForCondition(function() {
     logActiveElement();
     return document.activeElement === searchbar.textbox.inputField;
   });
 }
 
 // Ctrl+K should open the menu panel and focus the search bar if the search bar is in the panel.
 add_task(async function check_shortcut_when_in_closed_overflow_panel_closed() {
   CustomizableUI.addWidgetToArea(
@@ -60,45 +60,45 @@ add_task(async function check_shortcut_w
     !navbar.hasAttribute("overflowing"),
     "Should start with a non-overflowing toolbar."
   );
   ok(CustomizableUI.inDefaultState, "Should start in default state.");
 
   Services.prefs.setBoolPref("browser.search.widget.inNavBar", true);
 
   window.resizeTo(kForceOverflowWidthPx, window.outerHeight);
-  await waitForCondition(() => {
+  await TestUtils.waitForCondition(() => {
     return (
       navbar.getAttribute("overflowing") == "true" &&
       !navbar.querySelector("#search-container")
     );
   });
   ok(
     !navbar.querySelector("#search-container"),
     "Search container should be overflowing"
   );
 
   let shownPanelPromise = promiseOverflowShown(window);
   sendWebSearchKeyCommand();
   await shownPanelPromise;
 
   let chevron = document.getElementById("nav-bar-overflow-button");
-  await waitForCondition(() => chevron.open);
+  await TestUtils.waitForCondition(() => chevron.open);
 
   await waitForSearchBarFocus();
 
   let hiddenPanelPromise = promiseOverflowHidden(window);
   EventUtils.synthesizeKey("KEY_Escape");
   await hiddenPanelPromise;
 
   Services.prefs.setBoolPref("browser.search.widget.inNavBar", false);
 
   navbar = document.getElementById(CustomizableUI.AREA_NAVBAR);
   window.resizeTo(this.originalWindowWidth, window.outerHeight);
-  await waitForCondition(() => !navbar.hasAttribute("overflowing"));
+  await TestUtils.waitForCondition(() => !navbar.hasAttribute("overflowing"));
   ok(
     !navbar.hasAttribute("overflowing"),
     "Should not have an overflowing toolbar."
   );
 });
 
 // Ctrl+K should focus the search bar if it is in the navbar and not overflowing.
 add_task(async function check_shortcut_when_not_in_overflow() {