Bug 1354681 - Intermittent timeout in browser_ext_omnibox.js. r=mattw
MozReview-Commit-ID: 5gc6IvkMfXt
--- a/browser/components/extensions/test/browser/browser_ext_omnibox.js
+++ b/browser/components/extensions/test/browser/browser_ext_omnibox.js
@@ -95,16 +95,21 @@ add_task(function* () {
function* startInputSession() {
gURLBar.focus();
gURLBar.value = keyword;
EventUtils.synthesizeKey(" ", {});
yield expectEvent("on-input-started-fired");
EventUtils.synthesizeKey("t", {});
yield expectEvent("on-input-changed-fired", {text: "t"});
+ // Wait for the autocomplete search. Note that we cannot wait for the search
+ // to be complete, since the add-on doesn't communicate when it's done, so
+ // just check matches count.
+ yield BrowserTestUtils.waitForCondition(() => gURLBar.controller.matchCount >= 2,
+ "waiting urlbar search to complete");
return "t";
}
function* testInputEvents() {
gURLBar.focus();
// Start an input session by typing in <keyword><space>.
for (let letter of keyword) {
@@ -262,17 +267,16 @@ add_task(function* () {
});
yield testSuggestions({
test: "test-suggestions-after-delay",
skipHeuristic: true,
suggestions,
});
// Start monitoring the console.
- SimpleTest.waitForExplicitFinish();
let waitForConsole = new Promise(resolve => {
SimpleTest.monitorConsole(resolve, [{
message: new RegExp(`The keyword provided is already registered: "${keyword}"`),
}]);
});
// Try registering another extension with the same keyword
let extension2 = ExtensionTestUtils.loadExtension({