Bug 1405367 - Intermittent failure in browser_bug1070778.js. r=standard8 draft
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 23 Oct 2017 12:33:01 +0200
changeset 684645 e10589628b0daf82aa8ac1c68f8dc1ea703862c7
parent 684481 8ccbd32831c7c7e9a253aaa35834f1d7b7244672
child 736931 4c0e3e103301852aa224e9c26242562692e4ad6b
push id85689
push usermak77@bonardo.net
push dateMon, 23 Oct 2017 11:04:36 +0000
reviewersstandard8
bugs1405367, 1070778
milestone58.0a1
Bug 1405367 - Intermittent failure in browser_bug1070778.js. r=standard8 MozReview-Commit-ID: DaxUNMtdtNl
browser/base/content/test/urlbar/browser_bug1070778.js
--- a/browser/base/content/test/urlbar/browser_bug1070778.js
+++ b/browser/base/content/test/urlbar/browser_bug1070778.js
@@ -24,32 +24,32 @@ add_task(async function() {
   registerCleanupFunction(async function() {
     for (let bm of bookmarks) {
       await PlacesUtils.bookmarks.remove(bm);
     }
   });
 
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:mozilla");
   await promiseAutocompleteResultPopup("keyword a");
+  await waitForAutocompleteResultAt(1);
 
   // First item should already be selected
   is_selected(0);
   // Select next one (important!)
   EventUtils.synthesizeKey("VK_DOWN", {});
   is_selected(1);
   // Re-select keyword item
   EventUtils.synthesizeKey("VK_UP", {});
   is_selected(0);
 
   EventUtils.synthesizeKey("b", {});
   await promiseSearchComplete();
 
   is(gURLBar.textValue, "keyword ab", "urlbar should have expected input");
-
-  let result = gURLBar.popup.richlistbox.firstChild;
+  let result = await waitForAutocompleteResultAt(0);
   isnot(result, null, "Should have first item");
   let uri = NetUtil.newURI(result.getAttribute("url"));
   is(uri.spec, PlacesUtils.mozActionURI("keyword", {url: "http://example.com/?q=ab", input: "keyword ab"}), "Expect correct url");
 
   EventUtils.synthesizeKey("VK_ESCAPE", {});
   await promisePopupHidden(gURLBar.popup);
   gBrowser.removeTab(tab);
 });