Bug 1536753 - browser_test_focus_urlbar.js: make waitForSearchFinish work with the quantumbar enabled. r=Standard8
authorDão Gottwald <dao@mozilla.com>
Wed, 20 Mar 2019 10:29:26 +0000
changeset 524007 1a7a7301a3316e991c8d136bd8d4abac32679b44
parent 524006 edf29546c0960898e36ece643824527e73b77e6b
child 524008 68525cb9342aab778984168795d5830f1f89b38f
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1536753
milestone68.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 1536753 - browser_test_focus_urlbar.js: make waitForSearchFinish work with the quantumbar enabled. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D24144
accessible/tests/browser/events/browser_test_focus_urlbar.js
--- a/accessible/tests/browser/events/browser_test_focus_urlbar.js
+++ b/accessible/tests/browser/events/browser_test_focus_urlbar.js
@@ -18,16 +18,22 @@ function isEventForAutocompleteItem(even
 
 /**
  * Wait for an autocomplete search to finish.
  * This is necessary to ensure predictable results, as these searches are
  * async. Pressing down arrow will use results from the previous input if the
  * search isn't finished yet.
  */
 function waitForSearchFinish() {
+  if (UrlbarPrefs.get("quantumbar")) {
+    return Promise.all([
+      gURLBar.lastQueryContextPromise,
+      BrowserTestUtils.waitForCondition(() => gURLBar.view.isOpen)
+    ]);
+  }
   return BrowserTestUtils.waitForCondition(() =>
     (gURLBar.popupOpen && gURLBar.controller.searchStatus >=
       Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH),
     "Waiting for search to complete");
 }
 
 // Check that the URL bar manages accessibility focus appropriately.
 async function runTests() {