Bug 1405367 - Intermittent failure in browser_bug1070778.js. r=standard8
MozReview-Commit-ID: DaxUNMtdtNl
--- 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);
});