diff --git a/browser/components/urlbar/tests/UrlbarTestUtils.jsm b/browser/components/urlbar/tests/UrlbarTestUtils.jsm index 1a3f26a1efbe..617dc4e76271 100644 --- a/browser/components/urlbar/tests/UrlbarTestUtils.jsm +++ b/browser/components/urlbar/tests/UrlbarTestUtils.jsm @@ -25,6 +25,16 @@ XPCOMUtils.defineLazyModuleGetters(this, { }); var UrlbarTestUtils = { + /** + * Running this init allows helpers to access test scope helpers, like Assert + * and SimpleTest. Note this initialization is not enforced, thus helpers + * should always check _testScope and provide a fallback path. + * @param {object} scope The global scope where tests are being run. + */ + init(scope) { + this._testScope = scope; + }, + /** * Waits to a search to be complete. * @param {object} win The window containing the urlbar @@ -55,7 +65,11 @@ var UrlbarTestUtils = { selectionStart = -1, selectionEnd = -1, } = {}) { - await new Promise(resolve => waitForFocus(resolve, window)); + if (this._testScope) { + await this._testScope.SimpleTest.promiseFocus(window); + } else { + await new Promise(resolve => waitForFocus(resolve, window)); + } window.gURLBar.inputField.focus(); // Using the value setter in some cases may trim and fetch unexpected // results, then pick an alternate path. @@ -282,6 +296,9 @@ var UrlbarTestUtils = { if (win.gURLBar.view.isOpen) { return; } + if (this._testScope) { + this._testScope.info("Awaiting for the urlbar panel to open"); + } await new Promise(resolve => { win.gURLBar.controller.addQueryListener({ onViewOpen() { @@ -308,6 +325,9 @@ var UrlbarTestUtils = { if (!win.gURLBar.view.isOpen) { return; } + if (this._testScope) { + this._testScope.info("Awaiting for the urlbar panel to close"); + } await new Promise(resolve => { win.gURLBar.controller.addQueryListener({ onViewClose() { diff --git a/browser/components/urlbar/tests/browser-tips/browser_interventions.js b/browser/components/urlbar/tests/browser-tips/browser_interventions.js index 5dff41dc331b..cb58c8b90187 100644 --- a/browser/components/urlbar/tests/browser-tips/browser_interventions.js +++ b/browser/components/urlbar/tests/browser-tips/browser_interventions.js @@ -94,7 +94,7 @@ add_task(async function multipleInterventionsInOneEngagement() { ); // Blur the urlbar so that the engagement is ended. - await UrlbarTestUtils.promisePopupClose(window, () => window.gURLBar.blur()); + await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur()); const scalars = TelemetryTestUtils.getProcessScalars("parent", true, true); // We should only record one impression for the Refresh tip. Although it was @@ -120,7 +120,7 @@ add_task(async function tipsAreEnglishOnly() { result.payload.type, UrlbarProviderInterventions.TIP_TYPE.REFRESH ); - await UrlbarTestUtils.promisePopupClose(window, () => window.gURLBar.blur()); + await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur()); // We will need to fetch new engines when we switch locales. let searchReinit = SearchTestUtils.promiseSearchNotification( @@ -148,7 +148,7 @@ add_task(async function tipsAreEnglishOnly() { // Interventions should no longer work in the new locale. await awaitNoTip(SEARCH_STRINGS.CLEAR, window); - await UrlbarTestUtils.promisePopupClose(window, () => window.gURLBar.blur()); + await UrlbarTestUtils.promisePopupClose(window, () => gURLBar.blur()); }); /** diff --git a/browser/components/urlbar/tests/browser-tips/browser_picks.js b/browser/components/urlbar/tests/browser-tips/browser_picks.js index bc47111ae2ee..9aacddfad08c 100644 --- a/browser/components/urlbar/tests/browser-tips/browser_picks.js +++ b/browser/components/urlbar/tests/browser-tips/browser_picks.js @@ -69,7 +69,6 @@ add_task(async function mouse_insideTipButNotOnButtons() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus, fireInputEvent: true, }); let row = await UrlbarTestUtils.waitForAutocompleteResultAt(window, 0); @@ -155,7 +154,6 @@ async function doTest({ click, buttonUrl = undefined, helpUrl = undefined }) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus, fireInputEvent: true, }); let row = await UrlbarTestUtils.waitForAutocompleteResultAt(window, 0); diff --git a/browser/components/urlbar/tests/browser-tips/browser_searchTips.js b/browser/components/urlbar/tests/browser-tips/browser_searchTips.js index e3420b395055..094bf8a77322 100644 --- a/browser/components/urlbar/tests/browser-tips/browser_searchTips.js +++ b/browser/components/urlbar/tests/browser-tips/browser_searchTips.js @@ -16,7 +16,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { ProfileAge: "resource://gre/modules/ProfileAge.jsm", UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm", UrlbarProviderSearchTips: "resource:///modules/UrlbarProviderSearchTips.jsm", - UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm", }); // These should match the same consts in UrlbarProviderSearchTips.jsm. diff --git a/browser/components/urlbar/tests/browser-tips/browser_searchTips_interaction.js b/browser/components/urlbar/tests/browser-tips/browser_searchTips_interaction.js index 962d4ce70845..d011f4f1c0dc 100644 --- a/browser/components/urlbar/tests/browser-tips/browser_searchTips_interaction.js +++ b/browser/components/urlbar/tests/browser-tips/browser_searchTips_interaction.js @@ -15,7 +15,6 @@ XPCOMUtils.defineLazyModuleGetters(this, { ProfileAge: "resource://gre/modules/ProfileAge.jsm", UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm", UrlbarProviderSearchTips: "resource:///modules/UrlbarProviderSearchTips.jsm", - UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm", }); XPCOMUtils.defineLazyServiceGetter( diff --git a/browser/components/urlbar/tests/browser-tips/browser_selection.js b/browser/components/urlbar/tests/browser-tips/browser_selection.js index 1bf15e748a5e..b7834a8518e8 100644 --- a/browser/components/urlbar/tests/browser-tips/browser_selection.js +++ b/browser/components/urlbar/tests/browser-tips/browser_selection.js @@ -35,7 +35,6 @@ add_task(async function tipIsSecondResult() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus, }); Assert.equal( @@ -144,7 +143,6 @@ add_task(async function tipIsOnlyResult() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus, }); Assert.equal( @@ -229,7 +227,6 @@ add_task(async function tipHasNoHelpButton() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus, }); Assert.equal( diff --git a/browser/components/urlbar/tests/browser-tips/head.js b/browser/components/urlbar/tests/browser-tips/head.js index ef11a4f3bae1..a2bbdac7d757 100644 --- a/browser/components/urlbar/tests/browser-tips/head.js +++ b/browser/components/urlbar/tests/browser-tips/head.js @@ -21,11 +21,25 @@ XPCOMUtils.defineLazyModuleGetters(this, { "resource:///modules/UrlbarProviderInterventions.jsm", UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm", UrlbarResult: "resource:///modules/UrlbarResult.jsm", - UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm", - SearchTestUtils: "resource://testing-common/SearchTestUtils.jsm", TelemetryTestUtils: "resource://testing-common/TelemetryTestUtils.jsm", }); +XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => { + const { UrlbarTestUtils: module } = ChromeUtils.import( + "resource://testing-common/UrlbarTestUtils.jsm" + ); + module.init(this); + return module; +}); + +XPCOMUtils.defineLazyGetter(this, "SearchTestUtils", () => { + const { SearchTestUtils: module } = ChromeUtils.import( + "resource://testing-common/SearchTestUtils.jsm" + ); + module.init(Assert, registerCleanupFunction); + return module; +}); + // For each intervention type, a search string that trigger the intervention. const SEARCH_STRINGS = { CLEAR: "firefox history", diff --git a/browser/components/urlbar/tests/browser/browser_action_searchengine.js b/browser/components/urlbar/tests/browser/browser_action_searchengine.js index df43ef5c44ab..2270b7b94b5b 100644 --- a/browser/components/urlbar/tests/browser/browser_action_searchengine.js +++ b/browser/components/urlbar/tests/browser/browser_action_searchengine.js @@ -40,7 +40,6 @@ add_task(async function setup() { async function testSearch(win, expectedName, expectedBaseUrl) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "open a search", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(win, 0); diff --git a/browser/components/urlbar/tests/browser/browser_action_searchengine_alias.js b/browser/components/urlbar/tests/browser/browser_action_searchengine_alias.js index b9fa1cb27934..93263a48e09c 100644 --- a/browser/components/urlbar/tests/browser/browser_action_searchengine_alias.js +++ b/browser/components/urlbar/tests/browser/browser_action_searchengine_alias.js @@ -44,7 +44,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "moz", }); Assert.equal( @@ -55,7 +54,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "moz open a search", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_backspaced.js b/browser/components/urlbar/tests/browser/browser_autoFill_backspaced.js index 65b83f99dd7a..92da82dfaf5f 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_backspaced.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_backspaced.js @@ -13,7 +13,6 @@ async function test_autocomplete(data) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: typed, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_canonize.js b/browser/components/urlbar/tests/browser/browser_autoFill_canonize.js index b0dd72e69c06..911b015edc67 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_canonize.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_canonize.js @@ -11,7 +11,6 @@ async function test_autocomplete(data) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typed, }); Assert.equal(gURLBar.value, autofilled, "autofilled value is as expected"); diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_firstResult.js b/browser/components/urlbar/tests/browser/browser_autoFill_firstResult.js index fbba1578d1cb..a425ddd4a7bc 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_firstResult.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_firstResult.js @@ -55,7 +55,6 @@ add_task(async function successfulAutofill() { add_task(async function firstResultNotAutofill() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "foo", fireInputEvent: true, }); @@ -77,7 +76,6 @@ add_task(async function caretNotAtEndOfSearchString() { // of the new search string. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "exam", selectionStart: "exa".length, selectionEnd: "exa".length, @@ -105,7 +103,6 @@ add_task(async function selectionNotEmpty() { // string, but make the selection non-empty. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "exam", selectionStart: "exa".length, selectionEnd: "exam".length, @@ -131,7 +128,6 @@ add_task(async function successfulAutofillAfterSettingPlaceholder() { // Now do another search. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "exam", selectionStart: "exam".length, selectionEnd: "exam".length, @@ -158,7 +154,6 @@ add_task(async function successfulAutofillPlaceholderSelected() { // new search string. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "exam", selectionStart: "exam".length, selectionEnd: "example.com/".length, @@ -177,7 +172,6 @@ add_task(async function successfulAutofillPlaceholderSelected() { async function doInitialAutofillSearch() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "ex", fireInputEvent: true, }); @@ -197,7 +191,6 @@ async function cleanUp() { // here, although that's not really necessary. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "reset last search string", }); await UrlbarTestUtils.promisePopupClose(window, () => { diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_paste.js b/browser/components/urlbar/tests/browser/browser_autoFill_paste.js index 556fe67fd877..47d92cb7d3f1 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_paste.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_paste.js @@ -16,7 +16,6 @@ add_task(async function test() { // Search for "e". It should autofill to example.com/. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "e", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_placeholder.js b/browser/components/urlbar/tests/browser/browser_autoFill_placeholder.js index 4c83c5bd7c5a..882a2b5aff45 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_placeholder.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_placeholder.js @@ -24,7 +24,6 @@ add_task(async function origin() { // initial value. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ex", fireInputEvent: true, }); @@ -58,7 +57,6 @@ add_task(async function tokenAlias() { // initial value. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "@__ex", fireInputEvent: true, }); @@ -83,7 +81,6 @@ add_task(async function noMatch1() { // initial value. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ex", fireInputEvent: true, }); @@ -106,7 +103,6 @@ add_task(async function noMatch1() { // won't happen. It's not important for this test to check that. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ex", fireInputEvent: true, }); @@ -135,7 +131,6 @@ add_task(async function noMatch2() { // initial value. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "moz", fireInputEvent: true, }); @@ -200,7 +195,6 @@ add_task(async function clear_placeholder_for_keyword_or_alias() { // initial value. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "e", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_preserve.js b/browser/components/urlbar/tests/browser/browser_autoFill_preserve.js index da981096d7e3..ae2bc3084a5e 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_preserve.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_preserve.js @@ -24,7 +24,6 @@ add_task(async function origin() { ]); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ExA", fireInputEvent: true, }); @@ -51,7 +50,6 @@ add_task(async function originPort() { ]); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ExA", fireInputEvent: true, }); @@ -78,7 +76,6 @@ add_task(async function originScheme() { ]); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "http://ExA", fireInputEvent: true, }); @@ -105,7 +102,6 @@ add_task(async function originPortScheme() { ]); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "http://ExA", fireInputEvents: true, }); @@ -133,7 +129,6 @@ add_task(async function url() { ]); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ExAmple.com/f", fireInputEvent: true, }); @@ -161,7 +156,6 @@ add_task(async function urlPort() { ]); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ExAmple.com:8888/f", fireInputEvents: true, }); @@ -192,7 +186,6 @@ add_task(async function tokenAlias() { }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "@ExA", fireInputEvent: true, }); @@ -218,7 +211,6 @@ add_task(async function backspaceNoAutofill() { ]); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "ExA", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_autoFill_undo.js b/browser/components/urlbar/tests/browser/browser_autoFill_undo.js index a36d11d1fb9a..c233da80f2c8 100644 --- a/browser/components/urlbar/tests/browser/browser_autoFill_undo.js +++ b/browser/components/urlbar/tests/browser/browser_autoFill_undo.js @@ -14,7 +14,6 @@ add_task(async function test() { // Search for "ex". It should autofill to example.com/. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "ex", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_autoOpen.js b/browser/components/urlbar/tests/browser/browser_autoOpen.js index 04a6164e943e..9c84a3b4b2d8 100644 --- a/browser/components/urlbar/tests/browser/browser_autoOpen.js +++ b/browser/components/urlbar/tests/browser/browser_autoOpen.js @@ -20,7 +20,7 @@ async function checkOpensOnFocus(win = window) { // Focus with the mouse. await UrlbarTestUtils.promisePopupOpen(win, () => { - EventUtils.synthesizeMouseAtCenter(win.gURLBar.inputField, {}); + EventUtils.synthesizeMouseAtCenter(win.gURLBar.inputField, {}, win); }); await UrlbarTestUtils.promisePopupClose(win, () => { win.gURLBar.blur(); @@ -56,7 +56,7 @@ add_task(async function newtabAndHome() { async browser => { // We don't wait for load, but we must ensure to be on the expected url. await TestUtils.waitForCondition( - () => window.gBrowser.currentURI.spec == url, + () => gBrowser.currentURI.spec == url, "Ensure we're on the expected page" ); await checkOpensOnFocus(); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_a11y_label.js b/browser/components/urlbar/tests/browser/browser_autocomplete_a11y_label.js index d02dba6dcc16..cac526ce5be3 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_a11y_label.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_a11y_label.js @@ -54,7 +54,6 @@ add_task(async function switchToTab() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "% robots", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -92,7 +91,6 @@ add_task(async function searchSuggestions() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); let length = await UrlbarTestUtils.getResultCount(window); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_autoselect.js b/browser/components/urlbar/tests/browser/browser_autocomplete_autoselect.js index 43c829de43ca..750cbb01a9b0 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_autoselect.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_autoselect.js @@ -74,7 +74,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "example.com/autocomplete", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_cursor.js b/browser/components/urlbar/tests/browser/browser_autocomplete_cursor.js index 0540b45c3107..5e0081a92cc0 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_cursor.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_cursor.js @@ -14,7 +14,6 @@ add_task(async function test_windowSwitch() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "www.mozilla.org", }); await UrlbarTestUtils.waitForAutocompleteResultAt(window, 0); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_edit_completed.js b/browser/components/urlbar/tests/browser/browser_autocomplete_edit_completed.js index 878d6e4ecf62..51e1972dcc5c 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_edit_completed.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_edit_completed.js @@ -24,7 +24,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "http://example.com", }); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js b/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js index 87f27bc86e1d..7fda51305ad2 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_enter_race.js @@ -30,7 +30,6 @@ add_task( taskWithNewTab(async function test_keyword() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "keyword bear", }); gURLBar.focus(); @@ -49,7 +48,6 @@ add_task( taskWithNewTab(async function test_sametext() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "example.com", fireInputEvent: true, }); @@ -76,7 +74,6 @@ add_task( taskWithNewTab(async function test_after_empty_search() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "", }); gURLBar.focus(); @@ -145,7 +142,6 @@ add_task( // the user removed text from the end. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "", }); await UrlbarTestUtils.promisePopupClose(window); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_no_title.js b/browser/components/urlbar/tests/browser/browser_autocomplete_no_title.js index 78d67a6881ef..13c9fc3fb5bb 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_no_title.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_no_title.js @@ -23,7 +23,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "bug1060642", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_readline_navigation.js b/browser/components/urlbar/tests/browser/browser_autocomplete_readline_navigation.js index 55687671959c..399612738d75 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_readline_navigation.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_readline_navigation.js @@ -50,7 +50,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "example.com/autocomplete", }); await UrlbarTestUtils.waitForAutocompleteResultAt(window, maxResults - 1); diff --git a/browser/components/urlbar/tests/browser/browser_autocomplete_tag_star_visibility.js b/browser/components/urlbar/tests/browser/browser_autocomplete_tag_star_visibility.js index 281e2db0b2fc..9531acd2cd5c 100644 --- a/browser/components/urlbar/tests/browser/browser_autocomplete_tag_star_visibility.js +++ b/browser/components/urlbar/tests/browser/browser_autocomplete_tag_star_visibility.js @@ -113,7 +113,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: testcase.input, }); diff --git a/browser/components/urlbar/tests/browser/browser_caret_navigation.js b/browser/components/urlbar/tests/browser/browser_caret_navigation.js index 0c301e14cf96..890acd30d6b1 100644 --- a/browser/components/urlbar/tests/browser/browser_caret_navigation.js +++ b/browser/components/urlbar/tests/browser/browser_caret_navigation.js @@ -11,7 +11,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "This is a generic sentence", }); await UrlbarTestUtils.promisePopupClose(window); diff --git a/browser/components/urlbar/tests/browser/browser_decode.js b/browser/components/urlbar/tests/browser/browser_decode.js index 5daabb8fc465..52f08d831a74 100644 --- a/browser/components/urlbar/tests/browser/browser_decode.js +++ b/browser/components/urlbar/tests/browser/browser_decode.js @@ -52,7 +52,6 @@ add_task(async function actionURILosslessDecode() { let url = "http://" + urlNoScheme; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: url, }); @@ -90,7 +89,6 @@ add_task(async function test_resultsDisplayDecoded() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "example", }); @@ -105,7 +103,6 @@ add_task(async function test_resultsDisplayDecoded() { async function checkInput(inputStr) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: inputStr, }); diff --git a/browser/components/urlbar/tests/browser/browser_delete.js b/browser/components/urlbar/tests/browser/browser_delete.js index 7f1eb4d8adec..48fce657ad11 100644 --- a/browser/components/urlbar/tests/browser/browser_delete.js +++ b/browser/components/urlbar/tests/browser/browser_delete.js @@ -37,7 +37,6 @@ function sendDelete() { async function testDelete() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "bug1105244", }); diff --git a/browser/components/urlbar/tests/browser/browser_deleteAllText.js b/browser/components/urlbar/tests/browser/browser_deleteAllText.js index 7cc212cf6afe..5b355fa47746 100644 --- a/browser/components/urlbar/tests/browser/browser_deleteAllText.js +++ b/browser/components/urlbar/tests/browser/browser_deleteAllText.js @@ -29,7 +29,6 @@ async function runTest() { // Do an initial search for "x". await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "x", fireInputEvent: true, }); @@ -76,7 +75,7 @@ async function deleteInput() { EventUtils.synthesizeKey("KEY_Backspace"); } Assert.ok( - window.gURLBar.view.isOpen, + gURLBar.view.isOpen, "View should remain open when deleting all input text" ); let queryContext = await UrlbarTestUtils.promiseSearchComplete(window); diff --git a/browser/components/urlbar/tests/browser/browser_display_selectedAction_Extensions.js b/browser/components/urlbar/tests/browser/browser_display_selectedAction_Extensions.js index 61a8693a6ff1..d3a51ede76d0 100644 --- a/browser/components/urlbar/tests/browser/browser_display_selectedAction_Extensions.js +++ b/browser/components/urlbar/tests/browser/browser_display_selectedAction_Extensions.js @@ -28,7 +28,6 @@ add_task(async function testSwitchToTabTextDisplay() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "omniboxtest ", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_dns_first_for_single_words.js b/browser/components/urlbar/tests/browser/browser_dns_first_for_single_words.js index d4f248f7575c..5a294afcbc46 100644 --- a/browser/components/urlbar/tests/browser/browser_dns_first_for_single_words.js +++ b/browser/components/urlbar/tests/browser/browser_dns_first_for_single_words.js @@ -30,7 +30,6 @@ add_task(async function test() { }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: str, }); EventUtils.synthesizeKey("KEY_Enter"); diff --git a/browser/components/urlbar/tests/browser/browser_downArrowKeySearch.js b/browser/components/urlbar/tests/browser/browser_downArrowKeySearch.js index f13dd9c6b3b5..15273b428574 100644 --- a/browser/components/urlbar/tests/browser/browser_downArrowKeySearch.js +++ b/browser/components/urlbar/tests/browser/browser_downArrowKeySearch.js @@ -40,7 +40,6 @@ add_task(async function url() { add_task(async function userTyping() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", fireInputEvent: true, }); @@ -59,7 +58,6 @@ add_task(async function userTyping() { add_task(async function empty() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js b/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js index c7da96bd9e6e..bbebc0f94066 100644 --- a/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js +++ b/browser/components/urlbar/tests/browser/browser_edit_invalid_url.js @@ -18,7 +18,6 @@ add_task(async function setup() { add_task(async function test_escape() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "invalid", }); // Look for our result. @@ -51,7 +50,6 @@ add_task(async function test_escape() { add_task(async function test_edit_url() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "invalid", }); // Look for our result. diff --git a/browser/components/urlbar/tests/browser/browser_handleCommand_fallback.js b/browser/components/urlbar/tests/browser/browser_handleCommand_fallback.js index 7c10df217ff9..962c0d79ef60 100644 --- a/browser/components/urlbar/tests/browser/browser_handleCommand_fallback.js +++ b/browser/components/urlbar/tests/browser/browser_handleCommand_fallback.js @@ -69,7 +69,6 @@ add_task(async function() { let promise = promiseLoadURL(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value, }); EventUtils.synthesizeKey("KEY_Enter"); diff --git a/browser/components/urlbar/tests/browser/browser_heuristicNotAddedFirst.js b/browser/components/urlbar/tests/browser/browser_heuristicNotAddedFirst.js index 62bcf543db51..7a25235d3485 100644 --- a/browser/components/urlbar/tests/browser/browser_heuristicNotAddedFirst.js +++ b/browser/components/urlbar/tests/browser/browser_heuristicNotAddedFirst.js @@ -54,7 +54,6 @@ add_task(async function slowHeuristicSelected() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus: SimpleTest.waitForFocus, }); // The first result should be the heuristic and it should be selected. @@ -127,7 +126,6 @@ add_task(async function oneOffRemainsSelected() { let searchPromise = UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus: SimpleTest.waitForFocus, }); // When the view opens, press the up arrow key to select the one-off search @@ -157,8 +155,8 @@ add_task(async function oneOffRemainsSelected() { // The one-off settings button should be selected. Assert.equal( - window.gURLBar.view.oneOffSearchButtons.selectedButton, - window.gURLBar.view.oneOffSearchButtons.settingsButtonCompact + gURLBar.view.oneOffSearchButtons.selectedButton, + gURLBar.view.oneOffSearchButtons.settingsButtonCompact ); await UrlbarTestUtils.promisePopupClose(window); diff --git a/browser/components/urlbar/tests/browser/browser_inputHistory.js b/browser/components/urlbar/tests/browser/browser_inputHistory.js index db90a7573dd4..f56f549d0fc9 100644 --- a/browser/components/urlbar/tests/browser/browser_inputHistory.js +++ b/browser/components/urlbar/tests/browser/browser_inputHistory.js @@ -16,7 +16,6 @@ async function bumpScore(uri, searchString, counts, useMouseClick = false) { for (let i = 0; i < counts.picks; ++i) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: searchString, }); let promise = BrowserTestUtils.waitForDocLoadAndStopIt( @@ -67,7 +66,6 @@ add_task(async function test_adaptive_with_search_terms() { await bumpScore(url2, "site", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -83,7 +81,6 @@ add_task(async function test_adaptive_with_search_terms() { await bumpScore(url2, "si", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -97,7 +94,6 @@ add_task(async function test_adaptive_with_search_terms() { await bumpScore(url2, "si", { visits: 3, picks: 1 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -111,7 +107,6 @@ add_task(async function test_adaptive_with_search_terms() { await bumpScore(url2, "si", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -125,7 +120,6 @@ add_task(async function test_adaptive_with_search_terms() { await bumpScore(url2, "site", { visits: 3, picks: 1 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -139,7 +133,6 @@ add_task(async function test_adaptive_with_search_terms() { await bumpScore(url2, "site", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -159,7 +152,6 @@ add_task(async function test_adaptive_with_decay() { await bumpScore(url2, "si", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -174,7 +166,6 @@ add_task(async function test_adaptive_with_decay() { await bumpScore(url1, "si", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -194,7 +185,6 @@ add_task(async function test_adaptive_limited() { await bumpScore(url2, "si", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -209,7 +199,6 @@ add_task(async function test_adaptive_limited() { await bumpScore(url1, "si", { visits: 3, picks: 3 }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -246,7 +235,6 @@ add_task(async function test_adaptive_limited() { let expectedBookmarkIndex = Math.floor(n / 4) + 2; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "site", }); let result = await UrlbarTestUtils.getDetailsOfResultAt( @@ -293,7 +281,6 @@ add_task(async function test_adaptive_behaviors() { }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "site", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -322,7 +309,6 @@ add_task(async function test_adaptive_mouse() { await bumpScore(url2, "site", { visits: 3, picks: 1 }, true); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); @@ -336,7 +322,6 @@ add_task(async function test_adaptive_mouse() { await bumpScore(url2, "site", { visits: 3, picks: 3 }, true); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "si", }); result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); diff --git a/browser/components/urlbar/tests/browser/browser_keyword.js b/browser/components/urlbar/tests/browser/browser_keyword.js index ad184ba447fa..9f9488737bbf 100644 --- a/browser/components/urlbar/tests/browser/browser_keyword.js +++ b/browser/components/urlbar/tests/browser/browser_keyword.js @@ -10,7 +10,6 @@ async function promise_first_result(inputText) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: inputText, }); diff --git a/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js b/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js index 091cf8dfde3d..7037bddb2e6d 100644 --- a/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js +++ b/browser/components/urlbar/tests/browser/browser_keywordBookmarklets.js @@ -33,7 +33,6 @@ add_task(async function setup() { info("Search keyword, then press enter"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "bm", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); @@ -45,7 +44,6 @@ add_task(async function setup() { info("Search keyword with searchstring, then press enter"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "bm a", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); @@ -56,7 +54,6 @@ add_task(async function setup() { async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "bm", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); @@ -69,7 +66,6 @@ add_task(async function setup() { info("Search keyword with searchstring, then click"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "bm a", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); diff --git a/browser/components/urlbar/tests/browser/browser_keywordSearch.js b/browser/components/urlbar/tests/browser/browser_keywordSearch.js index d2ad074b6126..5ba5805589cf 100644 --- a/browser/components/urlbar/tests/browser/browser_keywordSearch.js +++ b/browser/components/urlbar/tests/browser/browser_keywordSearch.js @@ -37,7 +37,6 @@ add_task(async function() { value => { return UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value, }); }, diff --git a/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js b/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js index fe3c4c5d2e28..80363bb9ace0 100644 --- a/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js +++ b/browser/components/urlbar/tests/browser/browser_keywordSearch_postData.js @@ -37,7 +37,6 @@ add_task(async function() { value => { return UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value, }); }, diff --git a/browser/components/urlbar/tests/browser/browser_keyword_override.js b/browser/components/urlbar/tests/browser/browser_keyword_override.js index 3f0952596415..c53adaef73c0 100644 --- a/browser/components/urlbar/tests/browser/browser_keyword_override.js +++ b/browser/components/urlbar/tests/browser/browser_keyword_override.js @@ -25,7 +25,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "keyword search", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); diff --git a/browser/components/urlbar/tests/browser/browser_keyword_select_and_type.js b/browser/components/urlbar/tests/browser/browser_keyword_select_and_type.js index d079cd5cec46..dc907b5ee973 100644 --- a/browser/components/urlbar/tests/browser/browser_keyword_select_and_type.js +++ b/browser/components/urlbar/tests/browser/browser_keyword_select_and_type.js @@ -44,7 +44,6 @@ add_task(async function() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "keyword a", }); await UrlbarTestUtils.waitForAutocompleteResultAt(window, 1); diff --git a/browser/components/urlbar/tests/browser/browser_new_tab_urlbar_reset.js b/browser/components/urlbar/tests/browser/browser_new_tab_urlbar_reset.js index f2f6b1578f5b..fc1319b63130 100644 --- a/browser/components/urlbar/tests/browser/browser_new_tab_urlbar_reset.js +++ b/browser/components/urlbar/tests/browser/browser_new_tab_urlbar_reset.js @@ -15,7 +15,6 @@ add_task(async function() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "m", }); assertOpen(); @@ -27,7 +26,6 @@ add_task(async function() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "m", }); assertOpen(); diff --git a/browser/components/urlbar/tests/browser/browser_oneOffs.js b/browser/components/urlbar/tests/browser/browser_oneOffs.js index 5cece6e4ca37..56f6fdcbd932 100644 --- a/browser/components/urlbar/tests/browser/browser_oneOffs.js +++ b/browser/components/urlbar/tests/browser/browser_oneOffs.js @@ -44,7 +44,6 @@ add_task(async function() { let typedValue = "browser_urlbarOneOffs"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, fireInputEvent: true, }); @@ -137,7 +136,6 @@ add_task(async function searchWith() { let typedValue = "foo"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); @@ -179,7 +177,6 @@ add_task(async function oneOffClick() { let typedValue = "foo.bar"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, }); await UrlbarTestUtils.getDetailsOfResultAt(window, 0); @@ -207,7 +204,6 @@ add_task(async function oneOffReturn() { let typedValue = "foo.bar"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, fireInputEvent: true, }); @@ -244,7 +240,6 @@ add_task(async function hiddenOneOffs() { let typedValue = "foo"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, fireInputEvent: true, }); @@ -266,7 +261,6 @@ add_task(async function hiddenWhenUsingSearchAlias() { let typedValue = "@example"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, fireInputEvent: true, }); @@ -281,7 +275,6 @@ add_task(async function hiddenWhenUsingSearchAlias() { typedValue = "not an engine alias"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_oneOffs_contextMenu.js b/browser/components/urlbar/tests/browser/browser_oneOffs_contextMenu.js index 2014342da450..40d9dd7a11cf 100644 --- a/browser/components/urlbar/tests/browser/browser_oneOffs_contextMenu.js +++ b/browser/components/urlbar/tests/browser/browser_oneOffs_contextMenu.js @@ -65,7 +65,6 @@ async function searchInTab(checkFn) { await BrowserTestUtils.withNewTab({ gBrowser }, async testBrowser => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); @@ -152,7 +151,6 @@ add_task(async function switchDefaultEngine() { await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); diff --git a/browser/components/urlbar/tests/browser/browser_oneOffs_searchSuggestions.js b/browser/components/urlbar/tests/browser/browser_oneOffs_searchSuggestions.js index 205094e570ac..f426dd8e5547 100644 --- a/browser/components/urlbar/tests/browser/browser_oneOffs_searchSuggestions.js +++ b/browser/components/urlbar/tests/browser/browser_oneOffs_searchSuggestions.js @@ -62,7 +62,6 @@ async function withSuggestionOnce(useFormHistory, testFn) { window, value, fireInputEvent: true, - waitForFocus: SimpleTest.waitForFocus, }); let index = await UrlbarTestUtils.promiseSuggestionsPresent(window); await assertState({ @@ -237,7 +236,6 @@ add_task(async function overridden_engine_not_reused() { let typedValue = "foo"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, fireInputEvent: true, }); @@ -272,7 +270,6 @@ add_task(async function overridden_engine_not_reused() { await UrlbarTestUtils.promisePopupClose(window); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: typedValue, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_oneOffs_settings.js b/browser/components/urlbar/tests/browser/browser_oneOffs_settings.js index 8376c5d0f5ae..e34284a4f7cd 100644 --- a/browser/components/urlbar/tests/browser/browser_oneOffs_settings.js +++ b/browser/components/urlbar/tests/browser/browser_oneOffs_settings.js @@ -39,7 +39,6 @@ async function selectSettings(activateFn) { async browser => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "example.com", }); await UrlbarTestUtils.waitForAutocompleteResultAt( diff --git a/browser/components/urlbar/tests/browser/browser_pasteAndGo.js b/browser/components/urlbar/tests/browser/browser_pasteAndGo.js index cc8146059943..980f84139ead 100644 --- a/browser/components/urlbar/tests/browser/browser_pasteAndGo.js +++ b/browser/components/urlbar/tests/browser/browser_pasteAndGo.js @@ -60,7 +60,6 @@ add_task(async function test_with_input_and_results() { // Test paste and go When there's some input and the results pane is open. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); const url = "http://example.com/"; diff --git a/browser/components/urlbar/tests/browser/browser_percent_encoded.js b/browser/components/urlbar/tests/browser/browser_percent_encoded.js index 92e67d730ca5..10b581b342fa 100644 --- a/browser/components/urlbar/tests/browser/browser_percent_encoded.js +++ b/browser/components/urlbar/tests/browser/browser_percent_encoded.js @@ -38,7 +38,6 @@ add_task(async function test() { info("Search for the decoded string."); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: decoded, }); Assert.equal( @@ -52,7 +51,6 @@ add_task(async function test() { info("Search for the encoded string."); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: encodeURIComponent(decoded), }); Assert.equal( diff --git a/browser/components/urlbar/tests/browser/browser_privateBrowsingWindowChange.js b/browser/components/urlbar/tests/browser/browser_privateBrowsingWindowChange.js index 480be78e37a4..50b97a77d2c1 100644 --- a/browser/components/urlbar/tests/browser/browser_privateBrowsingWindowChange.js +++ b/browser/components/urlbar/tests/browser/browser_privateBrowsingWindowChange.js @@ -31,7 +31,6 @@ add_task(async function() { info("Search in urlbar"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: urlbarTestValue, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_remotetab.js b/browser/components/urlbar/tests/browser/browser_remotetab.js index 2d50a00f3a11..51bb79eac2bf 100644 --- a/browser/components/urlbar/tests/browser/browser_remotetab.js +++ b/browser/components/urlbar/tests/browser/browser_remotetab.js @@ -79,7 +79,6 @@ add_task(async function test_remotetab_opens() { async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "Test Remote", }); diff --git a/browser/components/urlbar/tests/browser/browser_remove_match.js b/browser/components/urlbar/tests/browser/browser_remove_match.js index caa6005437bd..148b7806da2e 100644 --- a/browser/components/urlbar/tests/browser/browser_remove_match.js +++ b/browser/components/urlbar/tests/browser/browser_remove_match.js @@ -21,7 +21,6 @@ add_task(async function test_remove_history() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "from_urlbar", }); @@ -85,7 +84,6 @@ add_task(async function test_remove_form_history() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); @@ -154,7 +152,6 @@ add_task(async function test_remove_bookmark_doesnt() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "from_urlbar", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); diff --git a/browser/components/urlbar/tests/browser/browser_restoreEmptyInput.js b/browser/components/urlbar/tests/browser/browser_restoreEmptyInput.js index 27da49400d74..c8aeb0063491 100644 --- a/browser/components/urlbar/tests/browser/browser_restoreEmptyInput.js +++ b/browser/components/urlbar/tests/browser/browser_restoreEmptyInput.js @@ -14,7 +14,6 @@ add_task(async function test() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_resultSpan.js b/browser/components/urlbar/tests/browser/browser_resultSpan.js index 1ac44eb7f9c4..9c6eab9c3689 100644 --- a/browser/components/urlbar/tests/browser/browser_resultSpan.js +++ b/browser/components/urlbar/tests/browser/browser_resultSpan.js @@ -58,7 +58,6 @@ add_task(async function oneTip() { let context = await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus: SimpleTest.waitForFocus, }); checkResults(context.results, expectedResults); @@ -105,7 +104,6 @@ add_task(async function threeTips() { let context = await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus: SimpleTest.waitForFocus, }); checkResults(context.results, expectedResults); @@ -147,7 +145,6 @@ add_task(async function oneTip_nonRestricting() { let context = await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus: SimpleTest.waitForFocus, }); checkResults(context.results, expectedResults); @@ -203,7 +200,6 @@ add_task(async function threeTips_nonRestricting() { let context = await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus: SimpleTest.waitForFocus, }); checkResults(context.results, expectedResults); diff --git a/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js b/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js index 73b09f59f969..2c5a05b96d3b 100644 --- a/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js +++ b/browser/components/urlbar/tests/browser/browser_retainedResultsOnFocus.js @@ -105,7 +105,6 @@ async function test_window(win) { let autofill = url == "http://example.com/"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus, value: autofill ? "ex" : "foo", fireInputEvent: true, }); @@ -147,7 +146,6 @@ add_task(async function test_tabSwitch() { let win = await BrowserTestUtils.openNewBrowserWindow(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus, value: "ex", fireInputEvent: true, }); @@ -179,7 +177,6 @@ add_task(async function test_tabSwitch() { let tab2 = await BrowserTestUtils.openNewForegroundTab(win.gBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus, value: "ex", fireInputEvent: true, }); @@ -202,7 +199,6 @@ add_task(async function test_tabSwitch() { tab2 = await BrowserTestUtils.openNewForegroundTab(win.gBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus, value: "xam", fireInputEvent: true, }); @@ -226,7 +222,6 @@ add_task(async function test_tabSwitch() { info("autofill in tab2, switch to tab1, then back to tab2 with the mouse"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus, value: "e", fireInputEvent: true, }); @@ -367,7 +362,6 @@ add_task(async function test_pageproxystate_valid() { info("Search for a full url and confirm it with Enter"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus, value: "about:robots", fireInputEvent: true, }); @@ -415,7 +409,6 @@ add_task(async function test_clicks_after_autofill() { info("autofill in tab2, switch to tab1, then back to tab2 with the mouse"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus, value: "e", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_searchSettings.js b/browser/components/urlbar/tests/browser/browser_searchSettings.js index 92e07e508dff..ff89a868df1f 100644 --- a/browser/components/urlbar/tests/browser/browser_searchSettings.js +++ b/browser/components/urlbar/tests/browser/browser_searchSettings.js @@ -9,7 +9,6 @@ add_task(async function() { async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "a", }); diff --git a/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js b/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js index d5d5162028a3..2cd9b15b13d7 100644 --- a/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js +++ b/browser/components/urlbar/tests/browser/browser_searchSingleWordNotification.js @@ -57,7 +57,6 @@ async function runURLBarSearchTest({ value => { return UrlbarTestUtils.promiseAutocompleteResultPopup({ window: aWindow, - waitForFocus, value, }); }, diff --git a/browser/components/urlbar/tests/browser/browser_searchSuggestions.js b/browser/components/urlbar/tests/browser/browser_searchSuggestions.js index 5480907e6c7a..7039c02bd3b4 100644 --- a/browser/components/urlbar/tests/browser/browser_searchSuggestions.js +++ b/browser/components/urlbar/tests/browser/browser_searchSuggestions.js @@ -39,7 +39,6 @@ add_task(async function clickSuggestion() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); let [idx, suggestion, engineName] = await getFirstSuggestion(); @@ -80,7 +79,6 @@ async function testPressEnterOnSuggestion( gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); let [idx, suggestion, engineName] = await getFirstSuggestion(); @@ -141,7 +139,6 @@ add_task(async function copySuggestionText() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); let [idx, suggestion] = await getFirstSuggestion(); @@ -170,7 +167,6 @@ add_task(async function typeMaxChars() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, value, - waitForFocus: SimpleTest.waitForFocus, }); // Suggestions should be fetched since we allow them when typing, and the @@ -268,7 +264,6 @@ add_task(async function heuristicAddsFormHistory() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); diff --git a/browser/components/urlbar/tests/browser/browser_searchTelemetry.js b/browser/components/urlbar/tests/browser/browser_searchTelemetry.js index 4e4329a41d77..fd8b45026137 100644 --- a/browser/components/urlbar/tests/browser/browser_searchTelemetry.js +++ b/browser/components/urlbar/tests/browser/browser_searchTelemetry.js @@ -46,7 +46,6 @@ add_task(async function heuristicResultMouse() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "heuristicResult", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); @@ -70,7 +69,6 @@ add_task(async function heuristicResultKeyboard() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "heuristicResult", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0); @@ -93,7 +91,6 @@ add_task(async function searchSuggestionMouse() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "searchSuggestion", }); let idx = await getFirstSuggestionIndex(); @@ -116,7 +113,6 @@ add_task(async function searchSuggestionKeyboard() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "searchSuggestion", }); let idx = await getFirstSuggestionIndex(); @@ -139,7 +135,6 @@ add_task(async function formHistoryMouse() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); let index = await getFirstSuggestionIndex(); @@ -166,7 +161,6 @@ add_task(async function formHistoryKeyboard() { gURLBar.focus(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); let index = await getFirstSuggestionIndex(); diff --git a/browser/components/urlbar/tests/browser/browser_selectStaleResults.js b/browser/components/urlbar/tests/browser/browser_selectStaleResults.js index d09ea033490a..8732a6d356c8 100644 --- a/browser/components/urlbar/tests/browser/browser_selectStaleResults.js +++ b/browser/components/urlbar/tests/browser/browser_selectStaleResults.js @@ -54,7 +54,6 @@ add_task(async function viewContainsStaleRows() { // view due to the heuristic result, but that's not important.) await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "x", fireInputEvent: true, }); @@ -185,7 +184,6 @@ add_task(async function staleReplacedWithFresh() { // Search for "tes" and wait for the search to finish. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "tes", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_selectionKeyNavigation.js b/browser/components/urlbar/tests/browser/browser_selectionKeyNavigation.js index 338efc1857db..99f0a41d7d89 100644 --- a/browser/components/urlbar/tests/browser/browser_selectionKeyNavigation.js +++ b/browser/components/urlbar/tests/browser/browser_selectionKeyNavigation.js @@ -21,7 +21,6 @@ add_task(async function init() { add_task(async function downKey() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -50,7 +49,6 @@ add_task(async function downKey() { add_task(async function upKey() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -82,7 +80,6 @@ add_task(async function upKey() { add_task(async function pageDownKey() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -110,7 +107,6 @@ add_task(async function pageDownKey() { add_task(async function pageUpKey() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -138,7 +134,6 @@ add_task(async function pageUpKey() { add_task(async function pageDownKeyShowsView() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -152,7 +147,6 @@ add_task(async function pageDownKeyShowsView() { add_task(async function pageUpKeyShowsView() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js b/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js index 754620d6ab3f..0b3b03477092 100644 --- a/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js +++ b/browser/components/urlbar/tests/browser/browser_separatePrivateDefault.js @@ -101,7 +101,6 @@ add_task(async function test_nonsearch() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "exa", }); await AssertNoPrivateResult(window); @@ -113,7 +112,6 @@ add_task(async function test_search() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult(window, await Services.search.getDefault(), false); @@ -128,7 +126,6 @@ add_task(async function test_search_disabled_suggestions() { }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult(window, await Services.search.getDefault(), false); @@ -141,7 +138,6 @@ add_task(async function test_oneoff_selected_keyboard() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult(window, await Services.search.getDefault(), false); @@ -171,7 +167,6 @@ add_task(async function test_oneoff_selected_mouse() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult(window, await Services.search.getDefault(), false); @@ -209,7 +204,6 @@ add_task(async function test_search_private_engine() { await Services.search.setDefaultPrivate(engine); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult(window, engine, true); @@ -224,7 +218,6 @@ add_task(async function test_privateWindow() { }); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: privateWin, - waitForFocus: SimpleTest.waitForFocus, value: "unique198273982173", }); await AssertNoPrivateResult(privateWin); @@ -241,7 +234,6 @@ add_task(async function test_permanentPB() { let win = await BrowserTestUtils.openNewBrowserWindow(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "unique198273982173", }); await AssertNoPrivateResult(win); @@ -255,7 +247,6 @@ add_task(async function test_openPBWindow() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult( @@ -286,7 +277,6 @@ add_task(async function test_oneoff_selected_with_private_engine_mouse() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult( @@ -325,7 +315,6 @@ add_task(async function test_oneoff_selected_with_private_engine_keyboard() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "unique198273982173", }); await AssertPrivateResult( @@ -362,14 +351,12 @@ add_task(async function test_alias() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "alias", }); await AssertNoPrivateResult(window); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "alias something", }); await AssertNoPrivateResult(window); @@ -381,21 +368,18 @@ add_task(async function test_restrict() { ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: UrlbarTokenizer.RESTRICT.SEARCH, }); await AssertNoPrivateResult(window); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: UrlbarTokenizer.RESTRICT.SEARCH + " ", }); await AssertNoPrivateResult(window); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: " " + UrlbarTokenizer.RESTRICT.SEARCH, }); await AssertNoPrivateResult(window); @@ -408,7 +392,6 @@ add_task(async function test_restrict_search() { let engine = await Services.search.getDefaultPrivate(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: UrlbarTokenizer.RESTRICT.SEARCH + "test", }); let result = await AssertPrivateResult(window, engine, true); @@ -416,7 +399,6 @@ add_task(async function test_restrict_search() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "test" + UrlbarTokenizer.RESTRICT.SEARCH, }); result = await AssertPrivateResult(window, engine, true); diff --git a/browser/components/urlbar/tests/browser/browser_speculative_connect.js b/browser/components/urlbar/tests/browser/browser_speculative_connect.js index 37fedb32b68a..2b4d13281244 100644 --- a/browser/components/urlbar/tests/browser/browser_speculative_connect.js +++ b/browser/components/urlbar/tests/browser/browser_speculative_connect.js @@ -64,7 +64,6 @@ add_task(async function search_test() { info("Searching for 'foo'"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", fireInputEvent: true, }); @@ -99,7 +98,6 @@ add_task(async function popup_mousedown_test() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: searchString, fireInputEvent: true, }); @@ -140,7 +138,6 @@ add_task(async function test_autofill() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: searchString, fireInputEvent: true, }); @@ -171,7 +168,6 @@ add_task(async function test_autofill_privateContext() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: privateWin, - waitForFocus: SimpleTest.waitForFocus, value: searchString, fireInputEvent: true, }); @@ -192,7 +188,6 @@ add_task(async function test_no_heuristic_result() { info(`Searching for the empty string`); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js b/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js index b22459618e31..2df9464c3434 100644 --- a/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js +++ b/browser/components/urlbar/tests/browser/browser_speculative_connect_not_with_client_cert.js @@ -187,7 +187,6 @@ add_task( info(`Searching for '${searchString}'`); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: searchString, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_stop.js b/browser/components/urlbar/tests/browser/browser_stop.js index ac7e35de253d..1bc011a31c10 100644 --- a/browser/components/urlbar/tests/browser/browser_stop.js +++ b/browser/components/urlbar/tests/browser/browser_stop.js @@ -43,7 +43,6 @@ add_task(async function() { async function typeAndSubmitAndStop(url) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: url, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_stopSearchOnSelection.js b/browser/components/urlbar/tests/browser/browser_stopSearchOnSelection.js index 4942ba2cd3ec..3fc05a196fe5 100644 --- a/browser/components/urlbar/tests/browser/browser_stopSearchOnSelection.js +++ b/browser/components/urlbar/tests/browser/browser_stopSearchOnSelection.js @@ -50,7 +50,6 @@ add_task(async function mainTest() { // and the two suggestions. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "amp", }); await TestUtils.waitForCondition(() => { diff --git a/browser/components/urlbar/tests/browser/browser_suggestedIndex.js b/browser/components/urlbar/tests/browser/browser_suggestedIndex.js index 8144344f852d..563202036a8d 100644 --- a/browser/components/urlbar/tests/browser/browser_suggestedIndex.js +++ b/browser/components/urlbar/tests/browser/browser_suggestedIndex.js @@ -41,7 +41,6 @@ add_task(async function suggestedIndex() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); @@ -93,7 +92,6 @@ add_task(async function suggestedIndex_append() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "bar", }); diff --git a/browser/components/urlbar/tests/browser/browser_switchTab_closesUrlbarPopup.js b/browser/components/urlbar/tests/browser/browser_switchTab_closesUrlbarPopup.js index 482686526859..d17217649432 100644 --- a/browser/components/urlbar/tests/browser/browser_switchTab_closesUrlbarPopup.js +++ b/browser/components/urlbar/tests/browser/browser_switchTab_closesUrlbarPopup.js @@ -32,7 +32,6 @@ add_task(async function() { // Now open the popup. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "", }); // Check that the popup closes when we switch tab. diff --git a/browser/components/urlbar/tests/browser/browser_switchTab_currentTab.js b/browser/components/urlbar/tests/browser/browser_switchTab_currentTab.js index 67472f25c361..eccee800e3ee 100644 --- a/browser/components/urlbar/tests/browser/browser_switchTab_currentTab.js +++ b/browser/components/urlbar/tests/browser/browser_switchTab_currentTab.js @@ -18,7 +18,6 @@ add_task(async function test_switchTab_currentTab() { async () => { let context = await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "robot", }); Assert.ok( diff --git a/browser/components/urlbar/tests/browser/browser_switchTab_decodeuri.js b/browser/components/urlbar/tests/browser/browser_switchTab_decodeuri.js index 0e9d8e3310f6..fe23eceaf967 100644 --- a/browser/components/urlbar/tests/browser/browser_switchTab_decodeuri.js +++ b/browser/components/urlbar/tests/browser/browser_switchTab_decodeuri.js @@ -20,7 +20,6 @@ add_task(async function test_switchtab_decodeuri() { info("Wait for autocomplete"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "dummy_page", }); diff --git a/browser/components/urlbar/tests/browser/browser_switchTab_override.js b/browser/components/urlbar/tests/browser/browser_switchTab_override.js index e64abf3f27e4..dabce43612a3 100644 --- a/browser/components/urlbar/tests/browser/browser_switchTab_override.js +++ b/browser/components/urlbar/tests/browser/browser_switchTab_override.js @@ -29,7 +29,6 @@ add_task(async function test_switchtab_override() { info("Wait for autocomplete"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "dummy_page", }); diff --git a/browser/components/urlbar/tests/browser/browser_switchToTab_closes_newtab.js b/browser/components/urlbar/tests/browser/browser_switchToTab_closes_newtab.js index 37935127a55a..5031491d7e73 100644 --- a/browser/components/urlbar/tests/browser/browser_switchToTab_closes_newtab.js +++ b/browser/components/urlbar/tests/browser/browser_switchToTab_closes_newtab.js @@ -43,7 +43,6 @@ add_task(async function test_switchToTab_closes() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "dummy", }); diff --git a/browser/components/urlbar/tests/browser/browser_switchToTab_fullUrl_repeatedKeydown.js b/browser/components/urlbar/tests/browser/browser_switchToTab_fullUrl_repeatedKeydown.js index 4cfc275b84bc..8f80ac5841a4 100644 --- a/browser/components/urlbar/tests/browser/browser_switchToTab_fullUrl_repeatedKeydown.js +++ b/browser/components/urlbar/tests/browser/browser_switchToTab_fullUrl_repeatedKeydown.js @@ -32,7 +32,6 @@ add_task(async function test_switchToTab_url() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: TEST_URL, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_tabKeyBehavior.js b/browser/components/urlbar/tests/browser/browser_tabKeyBehavior.js index 22933e0704c3..d37f168f0636 100644 --- a/browser/components/urlbar/tests/browser/browser_tabKeyBehavior.js +++ b/browser/components/urlbar/tests/browser/browser_tabKeyBehavior.js @@ -20,7 +20,6 @@ add_task(async function tabWithSearchString() { info("Tab with a search string"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -28,7 +27,6 @@ add_task(async function tabWithSearchString() { info("Reverse Tab with a search string"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -39,7 +37,6 @@ add_task(async function tabNoSearchString() { info("Tab without a search string"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "", fireInputEvent: true, }); @@ -47,7 +44,6 @@ add_task(async function tabNoSearchString() { info("Reverse Tab without a search string"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "", fireInputEvent: true, }); @@ -58,7 +54,6 @@ add_task(async function tabAfterBlur() { info("Tab after closing the view"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -108,7 +103,6 @@ add_task(async function tabRetainedResultMouseFocus() { info("Tab after retained results with mouse focus"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -124,7 +118,6 @@ add_task(async function tabRetainedResultsKeyboardFocus() { info("Tab after retained results with keyboard focus"); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); @@ -140,7 +133,6 @@ add_task(async function tabRetainedResults() { info("Tab with a search string after mouse focus."); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "exam", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js b/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js index c2bfbb6a5b95..0e8ea75c1f57 100644 --- a/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js +++ b/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar.js @@ -182,7 +182,6 @@ async function checkAutocompleteResults(expected) { info("Searching open pages."); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: RESTRICT_TOKEN_OPENPAGE, }); diff --git a/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar_perwindowpb.js b/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar_perwindowpb.js index f347711d7b36..04cca75021a7 100644 --- a/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar_perwindowpb.js +++ b/browser/components/urlbar/tests/browser/browser_tabMatchesInAwesomebar_perwindowpb.js @@ -86,7 +86,6 @@ async function runTest(aSourceWindow, aDestWindow, aExpectSwitch, aCallback) { let searchString = TEST_URL; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: aDestWindow, - waitForFocus: SimpleTest.waitForFocus, value: searchString, }); diff --git a/browser/components/urlbar/tests/browser/browser_textruns.js b/browser/components/urlbar/tests/browser/browser_textruns.js index 83eed00d1d51..1dae7f840bfd 100644 --- a/browser/components/urlbar/tests/browser/browser_textruns.js +++ b/browser/components/urlbar/tests/browser/browser_textruns.js @@ -19,7 +19,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "textruns", }); let result = await UrlbarTestUtils.getDetailsOfResultAt(window, 1); diff --git a/browser/components/urlbar/tests/browser/browser_tokenAlias.js b/browser/components/urlbar/tests/browser/browser_tokenAlias.js index ea00354fceb5..c77eec789d97 100644 --- a/browser/components/urlbar/tests/browser/browser_tokenAlias.js +++ b/browser/components/urlbar/tests/browser/browser_tokenAlias.js @@ -322,7 +322,6 @@ add_task(async function enterAutofillsAlias() { for (let value of [ALIAS.substring(0, ALIAS.length - 1), ALIAS]) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value, selectionStart: value.length, selectionEnd: value.length, @@ -356,7 +355,6 @@ async function doSimpleTest(revertBetweenSteps) { // "@tes" -- not an alias, no highlight await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: ALIAS.substr(0, ALIAS.length - 1), fireInputEvent: true, }); @@ -371,7 +369,6 @@ async function doSimpleTest(revertBetweenSteps) { // "@test" -- alias, highlight await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: ALIAS, fireInputEvent: true, }); @@ -386,7 +383,6 @@ async function doSimpleTest(revertBetweenSteps) { // "@test foo" -- alias, highlight await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: ALIAS + " foo", fireInputEvent: true, }); @@ -401,7 +397,6 @@ async function doSimpleTest(revertBetweenSteps) { // "@test" -- alias, highlight await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: ALIAS, fireInputEvent: true, }); @@ -416,7 +411,6 @@ async function doSimpleTest(revertBetweenSteps) { // "@tes" -- not an alias, no highlight await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: ALIAS.substr(0, ALIAS.length - 1), fireInputEvent: true, }); @@ -485,7 +479,6 @@ function assertHighlighted(highlighted, expectedAlias) { add_task(async function hiddenEngine() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "@", fireInputEvent: true, }); @@ -513,7 +506,6 @@ add_task(async function hiddenEngine() { defaultEngine.hidden = true; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "@", fireInputEvent: true, }); @@ -544,7 +536,6 @@ add_task(async function hiddenEngine() { add_task(async function hiddenEngine() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "@", fireInptuEvent: true, }); @@ -572,7 +563,6 @@ add_task(async function hiddenEngine() { defaultEngine.hidden = true; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "@", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_top_sites.js b/browser/components/urlbar/tests/browser/browser_top_sites.js index 422e464a590a..9d35b8677736 100644 --- a/browser/components/urlbar/tests/browser/browser_top_sites.js +++ b/browser/components/urlbar/tests/browser/browser_top_sites.js @@ -45,7 +45,7 @@ async function checkDoesNotOpenOnFocus(win = window) { win.gURLBar.blur(); // Focus with the mouse. - EventUtils.synthesizeMouseAtCenter(win.gURLBar.inputField, {}); + EventUtils.synthesizeMouseAtCenter(win.gURLBar.inputField, {}, win); // Because the panel opening may not be immediate, we must wait a bit. // eslint-disable-next-line mozilla/no-arbitrary-setTimeout await new Promise(resolve => setTimeout(resolve, 500)); @@ -421,7 +421,6 @@ add_task(async function topSitesDisabled() { // gets cleared. await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: privateWin, - waitForFocus, value: "example", }); privateWin.gURLBar.select(); diff --git a/browser/components/urlbar/tests/browser/browser_typed_value.js b/browser/components/urlbar/tests/browser/browser_typed_value.js index 0e32d852352e..a01ee3e08eef 100644 --- a/browser/components/urlbar/tests/browser/browser_typed_value.js +++ b/browser/components/urlbar/tests/browser/browser_typed_value.js @@ -23,7 +23,6 @@ add_task(async function test_autofill() { let typed = "ex"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: typed, fireInputEvent: true, }); @@ -43,7 +42,6 @@ add_task(async function test_complete_selection() { let typed = "ex"; await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: typed, fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_updateRows.js b/browser/components/urlbar/tests/browser/browser_updateRows.js index 7d23e5483a2c..b1d6e983c7af 100644 --- a/browser/components/urlbar/tests/browser/browser_updateRows.js +++ b/browser/components/urlbar/tests/browser/browser_updateRows.js @@ -42,7 +42,6 @@ add_task(async function urlToTip() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus, }); // The result at index 1 should be the http://example.com/test visit. @@ -145,7 +144,6 @@ add_task(async function tipToURL() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ value: "test", window, - waitForFocus, }); // The result at index 1 should be the tip from our provider. diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js b/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js index 0c72284dc67a..aa0c1894cb6f 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_event_telemetry.js @@ -36,7 +36,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "x", fireInputEvent: true, }); @@ -63,7 +62,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "multi word query ", fireInputEvent: true, }); @@ -117,7 +115,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "moz", fireInputEvent: true, }); @@ -145,7 +142,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "moz", fireInputEvent: true, }); @@ -198,7 +194,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "kw test", fireInputEvent: true, }); @@ -276,7 +271,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "example", fireInputEvent: true, }); @@ -308,7 +302,6 @@ const tests = [ ); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "exa", fireInputEvent: true, }); @@ -339,7 +332,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "exa", fireInputEvent: true, }); @@ -369,7 +361,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "exa", fireInputEvent: true, }); @@ -399,7 +390,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "foo", fireInputEvent: true, }); @@ -433,7 +423,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "foo", fireInputEvent: true, }); @@ -462,7 +451,6 @@ const tests = [ win.gURLBar.select(); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "@", fireInputEvent: true, }); @@ -737,7 +725,6 @@ const tests = [ info("Reopen the view: type, blur, focus, confirm."); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "search", fireInputEvent: true, }); @@ -785,7 +772,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "x", fireInputEvent: true, }); @@ -810,7 +796,6 @@ const tests = [ info("Reopen the view: type, blur, focus, backspace, type, confirm."); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "search", fireInputEvent: true, }); @@ -859,7 +844,6 @@ const tests = [ info("Reopen the view: type, blur, focus, type (overwrite), confirm."); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "search", fireInputEvent: true, }); @@ -908,7 +892,6 @@ const tests = [ let promise = BrowserTestUtils.browserLoaded(win.gBrowser.selectedBrowser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "x", fireInputEvent: true, }); @@ -1026,7 +1009,6 @@ const noEventTests = [ let promise = BrowserTestUtils.browserLoaded(browser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "x", fireInputEvent: true, }); @@ -1046,7 +1028,6 @@ const noEventTests = [ let promise = BrowserTestUtils.browserLoaded(browser); await UrlbarTestUtils.promiseAutocompleteResultPopup({ window: win, - waitForFocus: SimpleTest.waitForFocus, value: "x", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/browser_urlbar_selection.js b/browser/components/urlbar/tests/browser/browser_urlbar_selection.js index 571333ce116e..e890ed17cf49 100644 --- a/browser/components/urlbar/tests/browser/browser_urlbar_selection.js +++ b/browser/components/urlbar/tests/browser/browser_urlbar_selection.js @@ -6,10 +6,6 @@ const exampleSearch = "f oo bar"; const exampleUrl = "https://example.com/1"; -const { UrlbarTestUtils } = ChromeUtils.import( - "resource://testing-common/UrlbarTestUtils.jsm" -); - function click(target) { let promise = BrowserTestUtils.waitForEvent(target, "click"); EventUtils.synthesizeMouseAtCenter(target, {}, target.ownerGlobal); diff --git a/browser/components/urlbar/tests/browser/browser_view_emptyResultSet.js b/browser/components/urlbar/tests/browser/browser_view_emptyResultSet.js index a4c0efd2757e..77b11adba8b6 100644 --- a/browser/components/urlbar/tests/browser/browser_view_emptyResultSet.js +++ b/browser/components/urlbar/tests/browser/browser_view_emptyResultSet.js @@ -9,7 +9,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); Assert.ok( @@ -31,7 +30,6 @@ add_task(async function() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: "foo", }); Assert.ok( diff --git a/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js b/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js index ec9d57d9e867..23d0e739094f 100644 --- a/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js +++ b/browser/components/urlbar/tests/browser/browser_view_resultDisplay.js @@ -28,7 +28,6 @@ async function testResult(input, expected) { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus: SimpleTest.waitForFocus, value: input.query, }); diff --git a/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js b/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js index 0497c0163579..9f396d558fde 100644 --- a/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js +++ b/browser/components/urlbar/tests/browser/browser_view_resultTypes_display.js @@ -73,7 +73,6 @@ add_task(async function test_tab_switch_result() { await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "about:mozilla", fireInputEvent: true, }); @@ -96,7 +95,6 @@ add_task(async function test_search_result() { await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "foo", fireInputEvent: true, }); @@ -140,7 +138,6 @@ add_task(async function test_url_result() { await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "example", fireInputEvent: true, }); @@ -168,7 +165,6 @@ add_task(async function test_keyword_result() { await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "get ", fireInputEvent: true, }); @@ -184,7 +180,6 @@ add_task(async function test_keyword_result() { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "get test", fireInputEvent: true, }); @@ -225,7 +220,6 @@ add_task(async function test_omnibox_result() { await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "omniboxtest ", fireInputEvent: true, }); @@ -306,7 +300,6 @@ add_task(async function test_remote_tab_result() { await BrowserTestUtils.withNewTab({ gBrowser }, async () => { await UrlbarTestUtils.promiseAutocompleteResultPopup({ window, - waitForFocus, value: "example", fireInputEvent: true, }); diff --git a/browser/components/urlbar/tests/browser/head-common.js b/browser/components/urlbar/tests/browser/head-common.js index 5418d9349a48..63b958359d42 100644 --- a/browser/components/urlbar/tests/browser/head-common.js +++ b/browser/components/urlbar/tests/browser/head-common.js @@ -9,11 +9,9 @@ XPCOMUtils.defineLazyModuleGetters(this, { PlacesUtils: "resource://gre/modules/PlacesUtils.jsm", PlacesTestUtils: "resource://testing-common/PlacesTestUtils.jsm", Preferences: "resource://gre/modules/Preferences.jsm", - SearchTestUtils: "resource://testing-common/SearchTestUtils.jsm", UrlbarProvider: "resource:///modules/UrlbarUtils.jsm", UrlbarProvidersManager: "resource:///modules/UrlbarProvidersManager.jsm", UrlbarResult: "resource:///modules/UrlbarResult.jsm", - UrlbarTestUtils: "resource://testing-common/UrlbarTestUtils.jsm", UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm", UrlbarUtils: "resource:///modules/UrlbarUtils.jsm", }); @@ -32,7 +30,21 @@ XPCOMUtils.defineLazyServiceGetter( "nsIClipboardHelper" ); -SearchTestUtils.init(Assert, registerCleanupFunction); +XPCOMUtils.defineLazyGetter(this, "UrlbarTestUtils", () => { + const { UrlbarTestUtils: module } = ChromeUtils.import( + "resource://testing-common/UrlbarTestUtils.jsm" + ); + module.init(this); + return module; +}); + +XPCOMUtils.defineLazyGetter(this, "SearchTestUtils", () => { + const { SearchTestUtils: module } = ChromeUtils.import( + "resource://testing-common/SearchTestUtils.jsm" + ); + module.init(Assert, registerCleanupFunction); + return module; +}); /** * Initializes an HTTP Server, and runs a task with it. diff --git a/browser/modules/test/browser/browser_UsageTelemetry_urlbar_topsite.js b/browser/modules/test/browser/browser_UsageTelemetry_urlbar_topsite.js index 588c2978fe95..31c0ab41f892 100644 --- a/browser/modules/test/browser/browser_UsageTelemetry_urlbar_topsite.js +++ b/browser/modules/test/browser/browser_UsageTelemetry_urlbar_topsite.js @@ -109,7 +109,7 @@ add_task(async function test() { const histograms = snapshotHistograms(); await UrlbarTestUtils.promisePopupOpen(window, () => { - EventUtils.synthesizeMouseAtCenter(window.gURLBar.inputField, {}); + EventUtils.synthesizeMouseAtCenter(gURLBar.inputField, {}); }); await UrlbarTestUtils.promiseSearchComplete(window); @@ -141,7 +141,7 @@ add_task(async function test() { URLBAR_SELECTED_RESULT_METHODS.arrowEnterSelection ); await UrlbarTestUtils.promisePopupClose(window, () => { - window.gURLBar.blur(); + gURLBar.blur(); }); }); });