зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1864896: Autofix unused function arguments (browser/components/urlbar). r=mak
Differential Revision: https://phabricator.services.mozilla.com/D202954
This commit is contained in:
Родитель
1fe4db4a69
Коммит
dcc5780a01
|
@ -102,11 +102,11 @@ export class UrlbarEventBufferer {
|
|||
}
|
||||
}
|
||||
|
||||
onQueryCancelled(queryContext) {
|
||||
onQueryCancelled() {
|
||||
this._lastQuery.status = QUERY_STATUS.COMPLETE;
|
||||
}
|
||||
|
||||
onQueryFinished(queryContext) {
|
||||
onQueryFinished() {
|
||||
this._lastQuery.status = QUERY_STATUS.COMPLETE;
|
||||
}
|
||||
|
||||
|
|
|
@ -627,7 +627,7 @@ export class UrlbarInput {
|
|||
handleNavigation({ event, oneOffParams, triggeringPrincipal }) {
|
||||
let element = this.view.selectedElement;
|
||||
let result = this.view.getResultFromElement(element);
|
||||
let openParams = oneOffParams?.openParams || {};
|
||||
let openParams = oneOffParams?.openParams || { triggeringPrincipal };
|
||||
|
||||
// If the value was submitted during composition, the result may not have
|
||||
// been updated yet, because the input event happens after composition end.
|
||||
|
@ -794,7 +794,7 @@ export class UrlbarInput {
|
|||
this.pickResult(newResult, event, null, browser);
|
||||
}
|
||||
})
|
||||
.catch(ex => {
|
||||
.catch(() => {
|
||||
if (url) {
|
||||
// Something went wrong, we should always have a heuristic result,
|
||||
// otherwise it means we're not able to search at all, maybe because
|
||||
|
@ -3472,11 +3472,11 @@ export class UrlbarInput {
|
|||
Services.obs.notifyObservers(null, "urlbar-focus");
|
||||
}
|
||||
|
||||
_on_mouseover(event) {
|
||||
_on_mouseover() {
|
||||
this._updateUrlTooltip();
|
||||
}
|
||||
|
||||
_on_draggableregionleftmousedown(event) {
|
||||
_on_draggableregionleftmousedown() {
|
||||
if (!lazy.UrlbarPrefs.get("ui.popup.disable_autohide")) {
|
||||
this.view.close();
|
||||
}
|
||||
|
@ -3650,7 +3650,7 @@ export class UrlbarInput {
|
|||
});
|
||||
}
|
||||
|
||||
_on_selectionchange(event) {
|
||||
_on_selectionchange() {
|
||||
// Confirm placeholder as user text if it gets explicitly deselected. This
|
||||
// happens when the user wants to modify the autofilled text by either
|
||||
// clicking on it, or pressing HOME, END, RIGHT, …
|
||||
|
@ -3665,7 +3665,7 @@ export class UrlbarInput {
|
|||
}
|
||||
}
|
||||
|
||||
_on_select(event) {
|
||||
_on_select() {
|
||||
// On certain user input, AutoCopyListener::OnSelectionChange() updates
|
||||
// the primary selection with user-selected text (when supported).
|
||||
// Selection::NotifySelectionListeners() then dispatches a "select" event
|
||||
|
@ -3856,11 +3856,11 @@ export class UrlbarInput {
|
|||
return new lazy.UrlbarQueryContext(options);
|
||||
}
|
||||
|
||||
_on_scrollend(event) {
|
||||
_on_scrollend() {
|
||||
this.updateTextOverflow();
|
||||
}
|
||||
|
||||
_on_TabSelect(event) {
|
||||
_on_TabSelect() {
|
||||
this._gotTabSelect = true;
|
||||
this._afterTabSelectAndFocusChange();
|
||||
}
|
||||
|
@ -3935,7 +3935,7 @@ export class UrlbarInput {
|
|||
}
|
||||
}
|
||||
|
||||
_on_compositionstart(event) {
|
||||
_on_compositionstart() {
|
||||
if (this._compositionState == lazy.UrlbarUtils.COMPOSITION.COMPOSING) {
|
||||
throw new Error("Trying to start a nested composition?");
|
||||
}
|
||||
|
|
|
@ -1269,7 +1269,7 @@ class Preferences {
|
|||
}
|
||||
}
|
||||
|
||||
_migrateFirefoxSuggestPrefsTo_2(scenario) {
|
||||
_migrateFirefoxSuggestPrefsTo_2() {
|
||||
// In previous versions of the prefs for online, suggestions were disabled
|
||||
// by default; in version 2, they're enabled by default. For users who were
|
||||
// already in online and did not enable suggestions (because they did not
|
||||
|
|
|
@ -395,7 +395,7 @@ class ProviderAutofill extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {number} The provider's priority for the given query.
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -429,7 +429,7 @@ class ProviderAutofill extends UrlbarProvider {
|
|||
*
|
||||
* @param {object} queryContext The query context object
|
||||
*/
|
||||
cancelQuery(queryContext) {
|
||||
cancelQuery() {
|
||||
if (this._autofillData?.instance == this.queryInstance) {
|
||||
this._autofillData = null;
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ class ProviderCalculator extends UrlbarProvider {
|
|||
return viewUpdate;
|
||||
}
|
||||
|
||||
onEngagement(state, queryContext, details, controller) {
|
||||
onEngagement(state, queryContext, details) {
|
||||
let { result } = details;
|
||||
if (result?.providerName == this.name) {
|
||||
lazy.ClipboardHelper.copyString(result.payload.value);
|
||||
|
@ -306,7 +306,7 @@ Parser.prototype = {
|
|||
// This method returns an array of objects with these properties:
|
||||
// - number: true/false
|
||||
// - value: the token value
|
||||
parse(input) {
|
||||
parse() {
|
||||
// The input must be a "block" without any digit left.
|
||||
if (!this._tokenizeBlock() || this._chars.length) {
|
||||
throw new Error("Wrong input");
|
||||
|
|
|
@ -113,7 +113,7 @@ class ProviderClipboard extends UrlbarProvider {
|
|||
return null;
|
||||
}
|
||||
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
// Zero-prefix suggestions have the same priority as top sites.
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -135,7 +135,6 @@ class ProviderContextualSearch extends UrlbarProvider {
|
|||
engine = (
|
||||
await lazy.UrlbarSearchUtils.enginesForDomainPrefix(host, {
|
||||
matchAllDomainLevels: true,
|
||||
onlyEnabled: false,
|
||||
})
|
||||
)[0];
|
||||
}
|
||||
|
@ -220,7 +219,7 @@ class ProviderContextualSearch extends UrlbarProvider {
|
|||
* the DOM, as defined by the browser.
|
||||
* @returns {object} An object describing the view update.
|
||||
*/
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(result) {
|
||||
return {
|
||||
icon: {
|
||||
attributes: {
|
||||
|
|
|
@ -56,7 +56,7 @@ class ProviderHeuristicFallback extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {boolean} Whether this provider should be invoked for the search.
|
||||
*/
|
||||
isActive(queryContext) {
|
||||
isActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ class ProviderHeuristicFallback extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {number} The provider's priority for the given query.
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -544,7 +544,7 @@ class ProviderInterventions extends UrlbarProvider {
|
|||
);
|
||||
}
|
||||
|
||||
async _setCurrentTipFromAppUpdaterStatus(waitForCheck) {
|
||||
async _setCurrentTipFromAppUpdaterStatus() {
|
||||
// The update tips depend on the app's update status, so check for updates
|
||||
// now (if we haven't already checked within the update-check period). If
|
||||
// we're running in an xpcshell test, then checkForBrowserUpdate's attempt
|
||||
|
@ -671,7 +671,7 @@ class ProviderInterventions extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext the query context object to cancel
|
||||
* query for.
|
||||
*/
|
||||
cancelQuery(queryContext) {
|
||||
cancelQuery() {
|
||||
// If we're waiting for appUpdater to finish its update check,
|
||||
// this._appUpdaterListener will be defined. We can stop listening now.
|
||||
if (this._appUpdaterListener) {
|
||||
|
|
|
@ -95,7 +95,7 @@ class ProviderOmnibox extends UrlbarProvider {
|
|||
* @returns {number}
|
||||
* The provider's priority for the given query.
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ export class UrlbarProviderOpenTabs extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {boolean} Whether this provider should be invoked for the search.
|
||||
*/
|
||||
isActive(queryContext) {
|
||||
isActive() {
|
||||
// For now we don't actually use this provider to query open tabs, instead
|
||||
// we join the temp table in UrlbarProviderPlaces.
|
||||
return false;
|
||||
|
|
|
@ -1475,7 +1475,7 @@ class ProviderPlaces extends UrlbarProvider {
|
|||
*
|
||||
* @param {object} queryContext The query context object
|
||||
*/
|
||||
cancelQuery(queryContext) {
|
||||
cancelQuery() {
|
||||
if (this._currentSearch) {
|
||||
this._currentSearch.stop();
|
||||
}
|
||||
|
|
|
@ -786,7 +786,6 @@ class ProviderQuickSuggest extends UrlbarProvider {
|
|||
#recordNavSuggestionTelemetry({
|
||||
queryContext,
|
||||
result,
|
||||
resultSelType,
|
||||
resultClicked,
|
||||
details,
|
||||
}) {
|
||||
|
@ -833,7 +832,7 @@ class ProviderQuickSuggest extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext
|
||||
* The query context.
|
||||
*/
|
||||
cancelQuery(queryContext) {
|
||||
cancelQuery() {
|
||||
// Cancel the Rust query.
|
||||
let backend = lazy.QuickSuggest.getFeature("SuggestBackendRust");
|
||||
if (backend?.isEnabled) {
|
||||
|
|
|
@ -129,7 +129,7 @@ class ProviderQuickSuggestContextualOptIn extends UrlbarProvider {
|
|||
);
|
||||
}
|
||||
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return lazy.UrlbarProviderTopSites.PRIORITY;
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ class ProviderQuickSuggestContextualOptIn extends UrlbarProvider {
|
|||
* the DOM, as defined by the browser.
|
||||
* @returns {object} An object describing the view update.
|
||||
*/
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate() {
|
||||
let alternativeCopy = lazy.UrlbarPrefs.get(
|
||||
"quicksuggest.contextualOptIn.sayHello"
|
||||
);
|
||||
|
|
|
@ -320,7 +320,7 @@ class ProviderSearchSuggestions extends UrlbarProvider {
|
|||
*
|
||||
* @param {object} queryContext The query context object
|
||||
*/
|
||||
cancelQuery(queryContext) {
|
||||
cancelQuery() {
|
||||
if (this._suggestionsController) {
|
||||
this._suggestionsController.stop();
|
||||
this._suggestionsController = null;
|
||||
|
|
|
@ -163,7 +163,7 @@ class ProviderSearchTips extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {boolean} Whether this provider should be invoked for the search.
|
||||
*/
|
||||
isActive(queryContext) {
|
||||
isActive() {
|
||||
return this.currentTip && lazy.cfrFeaturesUserPref;
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ class ProviderSearchTips extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {number} The provider's priority for the given query.
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return this.PRIORITY;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ class ProviderTabToSearch extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {number} The provider's priority for the given query.
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,7 @@ class ProviderTabToSearch extends UrlbarProvider {
|
|||
* the DOM, as defined by the browser.
|
||||
* @returns {object} An object describing the view update.
|
||||
*/
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(result) {
|
||||
return {
|
||||
icon: {
|
||||
attributes: {
|
||||
|
@ -205,7 +205,7 @@ class ProviderTabToSearch extends UrlbarProvider {
|
|||
* @param {Element} element
|
||||
* The element in the result's view that was selected.
|
||||
*/
|
||||
onSelection(result, element) {
|
||||
onSelection(result) {
|
||||
// We keep track of the number of times the user interacts with
|
||||
// tab-to-search onboarding results so we stop showing them after
|
||||
// `tabToSearch.onboard.interactionsLeft` interactions.
|
||||
|
@ -232,7 +232,7 @@ class ProviderTabToSearch extends UrlbarProvider {
|
|||
}
|
||||
}
|
||||
|
||||
onEngagement(state, queryContext, details, controller) {
|
||||
onEngagement(state, queryContext, details) {
|
||||
let { result, element } = details;
|
||||
if (
|
||||
result?.providerName == this.name &&
|
||||
|
@ -354,7 +354,6 @@ class ProviderTabToSearch extends UrlbarProvider {
|
|||
searchStr,
|
||||
{
|
||||
matchAllDomainLevels: true,
|
||||
onlyEnabled: true,
|
||||
}
|
||||
);
|
||||
if (!engines.length) {
|
||||
|
|
|
@ -156,7 +156,7 @@ class ProviderTokenAliasEngines extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {number} The provider's priority for the given query.
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return this.PRIORITY;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ class ProviderTokenAliasEngines extends UrlbarProvider {
|
|||
*
|
||||
* @param {object} queryContext The query context object
|
||||
*/
|
||||
cancelQuery(queryContext) {
|
||||
cancelQuery() {
|
||||
if (this._autofillData?.instance == this.queryInstance) {
|
||||
this._autofillData = null;
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ class ProviderTopSites extends UrlbarProvider {
|
|||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @returns {number} The provider's priority for the given query.
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority() {
|
||||
return this.PRIORITY;
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ class ProviderTopSites extends UrlbarProvider {
|
|||
}
|
||||
}
|
||||
|
||||
onEngagement(state, queryContext, details, controller) {
|
||||
onEngagement(state, queryContext) {
|
||||
if (
|
||||
!queryContext.isPrivate &&
|
||||
this.sponsoredSites &&
|
||||
|
|
|
@ -169,7 +169,7 @@ class ProviderUnitConversion extends UrlbarProvider {
|
|||
addCallback(this, result);
|
||||
}
|
||||
|
||||
onEngagement(state, queryContext, details, controller) {
|
||||
onEngagement(state, queryContext, details) {
|
||||
let { result, element } = details;
|
||||
if (result?.providerName == this.name) {
|
||||
const { textContent } = element.querySelector(
|
||||
|
|
|
@ -163,7 +163,7 @@ class ProviderWeather extends UrlbarProvider {
|
|||
* update depend on element IDs, as some ARIA attributes do.
|
||||
* @returns {object} An object describing the view update.
|
||||
*/
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(result) {
|
||||
return lazy.QuickSuggest.weather.getViewUpdate(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,10 +71,7 @@ class SearchUtils {
|
|||
* @returns {Array<nsISearchEngine>}
|
||||
* An array of all matching engines. An empty array if there are none.
|
||||
*/
|
||||
async enginesForDomainPrefix(
|
||||
prefix,
|
||||
{ matchAllDomainLevels = false, onlyEnabled = false } = {}
|
||||
) {
|
||||
async enginesForDomainPrefix(prefix, { matchAllDomainLevels = false } = {}) {
|
||||
try {
|
||||
await this.init();
|
||||
} catch {
|
||||
|
|
|
@ -2147,11 +2147,11 @@ export class UrlbarQueryContext {
|
|||
for (let [prop, checkFn, defaultValue] of [
|
||||
["currentPage", v => typeof v == "string" && !!v.length],
|
||||
["formHistoryName", v => typeof v == "string" && !!v.length],
|
||||
["prohibitRemoteResults", v => true, false],
|
||||
["prohibitRemoteResults", () => true, false],
|
||||
["providers", v => Array.isArray(v) && v.length],
|
||||
["searchMode", v => v && typeof v == "object"],
|
||||
["sources", v => Array.isArray(v) && v.length],
|
||||
["view", v => true],
|
||||
["view", () => true],
|
||||
]) {
|
||||
if (prop in options) {
|
||||
if (!checkFn(options[prop])) {
|
||||
|
@ -2307,10 +2307,10 @@ export class UrlbarMuxer {
|
|||
/**
|
||||
* Sorts queryContext results in-place.
|
||||
*
|
||||
* @param {UrlbarQueryContext} queryContext the context to sort results for.
|
||||
* @param {UrlbarQueryContext} _queryContext the context to sort results for.
|
||||
* @abstract
|
||||
*/
|
||||
sort(queryContext) {
|
||||
sort(_queryContext) {
|
||||
throw new Error("Trying to access the base class, must be overridden");
|
||||
}
|
||||
}
|
||||
|
@ -2370,11 +2370,11 @@ export class UrlbarProvider {
|
|||
* If this method returns false, the providers manager won't start a query
|
||||
* with this provider, to save on resources.
|
||||
*
|
||||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @param {UrlbarQueryContext} _queryContext The query context object
|
||||
* @returns {boolean} Whether this provider should be invoked for the search.
|
||||
* @abstract
|
||||
*/
|
||||
isActive(queryContext) {
|
||||
isActive(_queryContext) {
|
||||
throw new Error("Trying to access the base class, must be overridden");
|
||||
}
|
||||
|
||||
|
@ -2384,11 +2384,11 @@ export class UrlbarProvider {
|
|||
* larger values are higher priorities. For a given query, `startQuery` is
|
||||
* called on only the active and highest-priority providers.
|
||||
*
|
||||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @param {UrlbarQueryContext} _queryContext The query context object
|
||||
* @returns {number} The provider's priority for the given query.
|
||||
* @abstract
|
||||
*/
|
||||
getPriority(queryContext) {
|
||||
getPriority(_queryContext) {
|
||||
// By default, all providers share the lowest priority.
|
||||
return 0;
|
||||
}
|
||||
|
@ -2399,30 +2399,30 @@ export class UrlbarProvider {
|
|||
* Note: Extended classes should return a Promise resolved when the provider
|
||||
* is done searching AND returning results.
|
||||
*
|
||||
* @param {UrlbarQueryContext} queryContext The query context object
|
||||
* @param {Function} addCallback Callback invoked by the provider to add a new
|
||||
* @param {UrlbarQueryContext} _queryContext The query context object
|
||||
* @param {Function} _addCallback Callback invoked by the provider to add a new
|
||||
* result. A UrlbarResult should be passed to it.
|
||||
* @abstract
|
||||
*/
|
||||
startQuery(queryContext, addCallback) {
|
||||
startQuery(_queryContext, _addCallback) {
|
||||
throw new Error("Trying to access the base class, must be overridden");
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels a running query,
|
||||
*
|
||||
* @param {UrlbarQueryContext} queryContext the query context object to cancel
|
||||
* @param {UrlbarQueryContext} _queryContext the query context object to cancel
|
||||
* query for.
|
||||
* @abstract
|
||||
*/
|
||||
cancelQuery(queryContext) {
|
||||
cancelQuery(_queryContext) {
|
||||
// Override this with your clean-up on cancel code.
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the user starts and ends an engagement with the urlbar.
|
||||
*
|
||||
* @param {string} state
|
||||
* @param {string} _state
|
||||
* The state of the engagement, one of the following strings:
|
||||
*
|
||||
* start
|
||||
|
@ -2436,11 +2436,11 @@ export class UrlbarProvider {
|
|||
* urlbar has discarded the engagement for some reason, and the
|
||||
* `onEngagement` implementation should ignore it.
|
||||
*
|
||||
* @param {UrlbarQueryContext} queryContext
|
||||
* @param {UrlbarQueryContext} _queryContext
|
||||
* The engagement's query context. This is *not* guaranteed to be defined
|
||||
* when `state` is "start". It will always be defined for "engagement" and
|
||||
* "abandonment".
|
||||
* @param {object} details
|
||||
* @param {object} _details
|
||||
* This object is non-empty only when `state` is "engagement" or
|
||||
* "abandonment", and it describes the search string and engaged result.
|
||||
*
|
||||
|
@ -2470,22 +2470,22 @@ export class UrlbarProvider {
|
|||
* The name of the provider that produced the picked result.
|
||||
*
|
||||
* For "abandonment", only `searchString` is defined.
|
||||
* @param {UrlbarController} controller
|
||||
* @param {UrlbarController} _controller
|
||||
* The associated controller.
|
||||
*/
|
||||
onEngagement(state, queryContext, details, controller) {}
|
||||
onEngagement(_state, _queryContext, _details, _controller) {}
|
||||
|
||||
/**
|
||||
* Called before a result from the provider is selected. See `onSelection`
|
||||
* for details on what that means.
|
||||
*
|
||||
* @param {UrlbarResult} result
|
||||
* @param {UrlbarResult} _result
|
||||
* The result that was selected.
|
||||
* @param {Element} element
|
||||
* @param {Element} _element
|
||||
* The element in the result's view that was selected.
|
||||
* @abstract
|
||||
*/
|
||||
onBeforeSelection(result, element) {}
|
||||
onBeforeSelection(_result, _element) {}
|
||||
|
||||
/**
|
||||
* Called when a result from the provider is selected. "Selected" refers to
|
||||
|
@ -2494,13 +2494,13 @@ export class UrlbarProvider {
|
|||
* event of a click, onSelection is called just before onEngagement. Note that
|
||||
* this is called when heuristic results are pre-selected.
|
||||
*
|
||||
* @param {UrlbarResult} result
|
||||
* @param {UrlbarResult} _result
|
||||
* The result that was selected.
|
||||
* @param {Element} element
|
||||
* @param {Element} _element
|
||||
* The element in the result's view that was selected.
|
||||
* @abstract
|
||||
*/
|
||||
onSelection(result, element) {}
|
||||
onSelection(_result, _element) {}
|
||||
|
||||
/**
|
||||
* This is called only for dynamic result types, when the urlbar view updates
|
||||
|
@ -2539,9 +2539,9 @@ export class UrlbarProvider {
|
|||
* element's name is not specified, then it will not be updated and will
|
||||
* retain its current state.
|
||||
*
|
||||
* @param {UrlbarResult} result
|
||||
* @param {UrlbarResult} _result
|
||||
* The result whose view will be updated.
|
||||
* @param {Map} idsByName
|
||||
* @param {Map} _idsByName
|
||||
* A Map from an element's name, as defined by the provider; to its ID in
|
||||
* the DOM, as defined by the browser. The browser manages element IDs for
|
||||
* dynamic results to prevent collisions. However, a provider may need to
|
||||
|
@ -2568,7 +2568,7 @@ export class UrlbarProvider {
|
|||
* {string} [textContent]
|
||||
* A string that will be set as `element.textContent`.
|
||||
*/
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(_result, _idsByName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -2578,7 +2578,7 @@ export class UrlbarProvider {
|
|||
* be handled by implementing `onEngagement()` with the possible exception of
|
||||
* commands automatically handled by the urlbar, like "help".
|
||||
*
|
||||
* @param {UrlbarResult} result
|
||||
* @param {UrlbarResult} _result
|
||||
* The menu will be shown for this result.
|
||||
* @returns {Array}
|
||||
* If the result doesn't have any commands, this should return null.
|
||||
|
@ -2597,7 +2597,7 @@ export class UrlbarProvider {
|
|||
* If specified, a submenu will be created with the given child commands.
|
||||
* Each object in the array must be a command object.
|
||||
*/
|
||||
getResultCommands(result) {
|
||||
getResultCommands(_result) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -2921,7 +2921,7 @@ export class L10nCache {
|
|||
* @param {string} data
|
||||
* The data attached to the notification.
|
||||
*/
|
||||
async observe(subject, topic, data) {
|
||||
async observe(subject, topic) {
|
||||
switch (topic) {
|
||||
case "intl:app-locales-changed": {
|
||||
await this.l10n.ready;
|
||||
|
|
|
@ -693,7 +693,7 @@ export class UrlbarView {
|
|||
this.#cacheL10nStrings();
|
||||
}
|
||||
|
||||
onQueryCancelled(queryContext) {
|
||||
onQueryCancelled() {
|
||||
this.#queryWasCancelled = true;
|
||||
this.#cancelRemoveStaleRowsTimer();
|
||||
}
|
||||
|
@ -1326,7 +1326,7 @@ export class UrlbarView {
|
|||
return item;
|
||||
}
|
||||
|
||||
#createRowContent(item, result) {
|
||||
#createRowContent(item) {
|
||||
// The url is the only element that can wrap, thus all the other elements
|
||||
// are child of noWrap.
|
||||
let noWrap = this.#createElement("span");
|
||||
|
@ -1505,7 +1505,7 @@ export class UrlbarView {
|
|||
return classes;
|
||||
}
|
||||
|
||||
#createRowContentForRichSuggestion(item, result) {
|
||||
#createRowContentForRichSuggestion(item) {
|
||||
item._content.toggleAttribute("selectable", true);
|
||||
|
||||
let favicon = this.#createElement("img");
|
||||
|
@ -3272,7 +3272,7 @@ export class UrlbarView {
|
|||
}
|
||||
}
|
||||
|
||||
on_blur(event) {
|
||||
on_blur() {
|
||||
// If the view is open without the input being focused, it will not close
|
||||
// automatically when the window loses focus. We might be in this state
|
||||
// after a Search Tip is shown on an engine homepage.
|
||||
|
|
|
@ -178,7 +178,7 @@ export class AddonSuggestions extends BaseFeature {
|
|||
);
|
||||
}
|
||||
|
||||
getResultCommands(result) {
|
||||
getResultCommands() {
|
||||
const commands = [];
|
||||
|
||||
if (this.canShowLessFrequently) {
|
||||
|
|
|
@ -135,7 +135,7 @@ export class AdmWikipedia extends BaseFeature {
|
|||
this.#suggestionsMap = suggestionsMap;
|
||||
}
|
||||
|
||||
makeResult(queryContext, suggestion, searchString) {
|
||||
makeResult(queryContext, suggestion) {
|
||||
let originalUrl;
|
||||
if (suggestion.source == "rust") {
|
||||
// The Rust backend defines `rawUrl` on AMP suggestions, and its value is
|
||||
|
|
|
@ -92,7 +92,7 @@ export class BaseFeature {
|
|||
* @param {boolean} enabled
|
||||
* Whether the feature should be enabled or not.
|
||||
*/
|
||||
enable(enabled) {}
|
||||
enable(_enabled) {}
|
||||
|
||||
/**
|
||||
* If the feature manages suggestions from remote settings that should be
|
||||
|
@ -105,7 +105,7 @@ export class BaseFeature {
|
|||
* @returns {Array}
|
||||
* An array of matching suggestions, or null if not implemented.
|
||||
*/
|
||||
async queryRemoteSettings(searchString) {
|
||||
async queryRemoteSettings(_searchString) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ export class BaseFeature {
|
|||
* @param {RemoteSettings} rs
|
||||
* The `RemoteSettings` client object.
|
||||
*/
|
||||
async onRemoteSettingsSync(rs) {}
|
||||
async onRemoteSettingsSync(_rs) {}
|
||||
|
||||
/**
|
||||
* If the feature manages suggestions that either aren't served by Merino or
|
||||
|
@ -131,7 +131,7 @@ export class BaseFeature {
|
|||
* @returns {string}
|
||||
* The suggestion's telemetry type.
|
||||
*/
|
||||
getSuggestionTelemetryType(suggestion) {
|
||||
getSuggestionTelemetryType(_suggestion) {
|
||||
return this.merinoProvider;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ export class BaseFeature {
|
|||
* @returns {boolean}
|
||||
* Whether the suggestion type is enabled.
|
||||
*/
|
||||
isRustSuggestionTypeEnabled(type) {
|
||||
isRustSuggestionTypeEnabled(_type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ export class BaseFeature {
|
|||
* @returns {UrlbarResult}
|
||||
* A new result for the suggestion.
|
||||
*/
|
||||
async makeResult(queryContext, suggestion, searchString) {
|
||||
async makeResult(_queryContext, _suggestion, _searchString) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ export class MDNSuggestions extends BaseFeature {
|
|||
this.#suggestionsMap = suggestionsMap;
|
||||
}
|
||||
|
||||
async makeResult(queryContext, suggestion, searchString) {
|
||||
async makeResult(queryContext, suggestion) {
|
||||
if (!this.isEnabled) {
|
||||
// The feature is disabled on the client, but Merino may still return
|
||||
// mdn suggestions anyway, and we filter them out here.
|
||||
|
@ -134,7 +134,7 @@ export class MDNSuggestions extends BaseFeature {
|
|||
);
|
||||
}
|
||||
|
||||
getResultCommands(result) {
|
||||
getResultCommands() {
|
||||
return [
|
||||
{
|
||||
l10n: {
|
||||
|
|
|
@ -171,14 +171,14 @@ export class Weather extends BaseFeature {
|
|||
return ["Weather"];
|
||||
}
|
||||
|
||||
isRustSuggestionTypeEnabled(type) {
|
||||
isRustSuggestionTypeEnabled() {
|
||||
// When weather keywords are defined in Nimbus, weather suggestions are
|
||||
// served by UrlbarProviderWeather. Return false here so the quick suggest
|
||||
// provider doesn't try to serve them too.
|
||||
return !lazy.UrlbarPrefs.get("weatherKeywords");
|
||||
}
|
||||
|
||||
getSuggestionTelemetryType(suggestion) {
|
||||
getSuggestionTelemetryType() {
|
||||
return "weather";
|
||||
}
|
||||
|
||||
|
@ -454,7 +454,7 @@ export class Weather extends BaseFeature {
|
|||
};
|
||||
}
|
||||
|
||||
getResultCommands(result) {
|
||||
getResultCommands() {
|
||||
let commands = [
|
||||
{
|
||||
name: RESULT_MENU_COMMAND.INACCURATE_LOCATION,
|
||||
|
|
|
@ -55,7 +55,7 @@ export class YelpSuggestions extends BaseFeature {
|
|||
return !cap || this.showLessFrequentlyCount < cap;
|
||||
}
|
||||
|
||||
getSuggestionTelemetryType(suggestion) {
|
||||
getSuggestionTelemetryType() {
|
||||
return "yelp";
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ export class YelpSuggestions extends BaseFeature {
|
|||
);
|
||||
}
|
||||
|
||||
getResultCommands(result) {
|
||||
getResultCommands() {
|
||||
let commands = [
|
||||
{
|
||||
name: RESULT_MENU_COMMAND.INACCURATE_LOCATION,
|
||||
|
|
|
@ -1536,11 +1536,11 @@ class TestProvider extends UrlbarProvider {
|
|||
return this._type;
|
||||
}
|
||||
|
||||
getPriority(context) {
|
||||
getPriority(_context) {
|
||||
return this.priority;
|
||||
}
|
||||
|
||||
isActive(context) {
|
||||
isActive(_context) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1565,7 +1565,7 @@ class TestProvider extends UrlbarProvider {
|
|||
}
|
||||
}
|
||||
|
||||
cancelQuery(context) {
|
||||
cancelQuery(_context) {
|
||||
this._onCancel?.();
|
||||
}
|
||||
|
||||
|
|
|
@ -680,7 +680,7 @@ add_task(async function noActionWhenDisabled() {
|
|||
],
|
||||
});
|
||||
|
||||
await withDNSRedirect("www.bing.com", "/", async url => {
|
||||
await withDNSRedirect("www.bing.com", "/", async () => {
|
||||
Assert.ok(
|
||||
!UrlbarTestUtils.isPopupOpen(window),
|
||||
"The UrlbarView should not be open."
|
||||
|
|
|
@ -99,7 +99,7 @@ add_task(async function viewUpdateAppendHidden() {
|
|||
// The `- 2` subtracts the heuristic and tip result.
|
||||
let newExpectedRowCount = 2 * expectedRowCount - 2;
|
||||
let mutationPromise = new Promise(resolve => {
|
||||
let observer = new MutationObserver(mutations => {
|
||||
let observer = new MutationObserver(() => {
|
||||
let childCount = UrlbarTestUtils.getResultCount(window);
|
||||
info(`Rows mutation observer called, childCount now ${childCount}`);
|
||||
if (newExpectedRowCount <= childCount) {
|
||||
|
|
|
@ -386,7 +386,7 @@ async function doSuggestedIndexTest({ search1, search2, duringUpdate }) {
|
|||
// update and delaying resolving the provider's finishQueryPromise.
|
||||
let mutationPromise = new Promise(resolve => {
|
||||
let lastRowState = duringUpdate[duringUpdate.length - 1];
|
||||
let observer = new MutationObserver(mutations => {
|
||||
let observer = new MutationObserver(() => {
|
||||
observer.disconnect();
|
||||
resolve();
|
||||
});
|
||||
|
|
|
@ -291,7 +291,7 @@ async function doDismissTest({ command, shouldBeSelected, resultIndex = -1 }) {
|
|||
* A provider that acknowledges feedback and dismissals.
|
||||
*/
|
||||
class TestProvider extends UrlbarTestUtils.TestProvider {
|
||||
getResultCommands(result) {
|
||||
getResultCommands(_result) {
|
||||
// The l10n values aren't important.
|
||||
return [
|
||||
{
|
||||
|
|
|
@ -321,5 +321,5 @@ function promiseEngine(expectedData, expectedEngineName) {
|
|||
expectedEngineName == engine.wrappedJSObject.name
|
||||
);
|
||||
}
|
||||
).then(([engine, data]) => engine);
|
||||
).then(([engine]) => engine);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ add_setup(async function () {
|
|||
add_task(async function test() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: "about:blank" },
|
||||
async browser => {
|
||||
async () => {
|
||||
await checkOpensOnFocus();
|
||||
}
|
||||
);
|
||||
|
|
|
@ -117,11 +117,7 @@ add_task(async function keySelection() {
|
|||
});
|
||||
});
|
||||
|
||||
async function checkBestMatchRow({
|
||||
result,
|
||||
isSponsored = false,
|
||||
hasHelpUrl = false,
|
||||
}) {
|
||||
async function checkBestMatchRow({ result, hasHelpUrl = false }) {
|
||||
Assert.equal(
|
||||
UrlbarTestUtils.getResultCount(window),
|
||||
1,
|
||||
|
|
|
@ -46,7 +46,7 @@ add_task(async function () {
|
|||
await SpecialPowers.spawn(tab.linkedBrowser, [], async function () {
|
||||
// This is sync, so by the time we return we should have changed the URL bar.
|
||||
content.location.reload();
|
||||
}).catch(e => {
|
||||
}).catch(() => {
|
||||
// Ignore expected exception.
|
||||
});
|
||||
is(
|
||||
|
|
|
@ -52,7 +52,7 @@ add_task(async function testFormattingOfClipboardSuggestion() {
|
|||
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: "about:home" },
|
||||
async browser => {
|
||||
async () => {
|
||||
let { result } = await searchEmptyStringAndGetFirstRow();
|
||||
|
||||
Assert.equal(
|
||||
|
|
|
@ -13,7 +13,7 @@ add_task(async function () {
|
|||
"http://www.example.com"
|
||||
) + "slow-page.sjs";
|
||||
|
||||
await BrowserTestUtils.withNewTab(gBrowser, async tab => {
|
||||
await BrowserTestUtils.withNewTab(gBrowser, async () => {
|
||||
gURLBar.focus();
|
||||
gURLBar.value = SLOW_PAGE;
|
||||
let promise = TestUtils.waitForCondition(
|
||||
|
|
|
@ -727,7 +727,7 @@ add_task(async function loadingPageInBlank() {
|
|||
async function waitForNewTabWithLoadRequest() {
|
||||
return new Promise(resolve =>
|
||||
gBrowser.addTabsProgressListener({
|
||||
onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
|
||||
onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags) {
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
|
||||
gBrowser.removeTabsProgressListener(this);
|
||||
resolve(gBrowser.getTabForBrowser(aBrowser));
|
||||
|
|
|
@ -43,7 +43,7 @@ function simulateURLBarDrop(content) {
|
|||
}
|
||||
|
||||
add_task(async function checkDragURL() {
|
||||
await BrowserTestUtils.withNewTab(TEST_URL, function (browser) {
|
||||
await BrowserTestUtils.withNewTab(TEST_URL, function () {
|
||||
info("Check dragging a normal url to the urlbar");
|
||||
const DRAG_URL = "http://www.example.com/";
|
||||
simulateURLBarDrop({ type: "text/plain", data: DRAG_URL });
|
||||
|
@ -61,7 +61,7 @@ add_task(async function checkDragURL() {
|
|||
});
|
||||
|
||||
add_task(async function checkDragForbiddenURL() {
|
||||
await BrowserTestUtils.withNewTab(TEST_URL, function (browser) {
|
||||
await BrowserTestUtils.withNewTab(TEST_URL, function () {
|
||||
// See also browser_removeUnsafeProtocolsFromURLBarPaste.js for other
|
||||
// examples. In general we trust that function, we pick some testcases to
|
||||
// ensure we disallow dropping trimmed text.
|
||||
|
|
|
@ -580,7 +580,7 @@ add_task(async function highlighting() {
|
|||
addCallback(this, result);
|
||||
}
|
||||
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(_result, _idsByName) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ add_task(async function highlighting() {
|
|||
* Provides a dynamic result with highlighted text that is then overridden.
|
||||
*/
|
||||
class TestHighlightProviderOveridden extends TestHighlightProvider {
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(_result, _idsByName) {
|
||||
return {
|
||||
text: {
|
||||
textContent: "Test title",
|
||||
|
@ -904,7 +904,7 @@ class TestProvider extends UrlbarTestUtils.TestProvider {
|
|||
};
|
||||
}
|
||||
|
||||
onEngagement(state, queryContext, details, controller) {
|
||||
onEngagement(state, queryContext, details, _controller) {
|
||||
if (this._pickPromiseResolve) {
|
||||
let { result, element } = details;
|
||||
this._pickPromiseResolve([result, element]);
|
||||
|
|
|
@ -139,7 +139,7 @@ add_task(async function generalBeforeSuggestions() {
|
|||
add_task(async function generalBeforeSuggestions_suggestionsOnly() {
|
||||
await PlacesUtils.history.clear();
|
||||
|
||||
await withSuggestions(async engine => {
|
||||
await withSuggestions(async () => {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [[SUGGESTIONS_FIRST_PREF, false]],
|
||||
});
|
||||
|
@ -196,7 +196,7 @@ add_task(async function suggestedIndex_only() {
|
|||
let provider = new SuggestedIndexProvider(index);
|
||||
UrlbarProvidersManager.registerProvider(provider);
|
||||
|
||||
await withSuggestions(async engine => {
|
||||
await withSuggestions(async () => {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: "test",
|
||||
|
|
|
@ -299,7 +299,7 @@ async function triggerCommand(eventType, details = {}) {
|
|||
function promiseLoadStarted() {
|
||||
return new Promise(resolve => {
|
||||
gBrowser.addTabsProgressListener({
|
||||
onStateChange(browser, webProgress, req, flags, status) {
|
||||
onStateChange(browser, webProgress, req, flags) {
|
||||
if (flags & Ci.nsIWebProgressListener.STATE_START) {
|
||||
gBrowser.removeTabsProgressListener(this);
|
||||
resolve();
|
||||
|
|
|
@ -52,7 +52,7 @@ function promiseLoaded(browser) {
|
|||
});
|
||||
}
|
||||
|
||||
async function testURL(url, loadFunc, endFunc) {
|
||||
async function testURL(url, loadFunc) {
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
|
@ -70,7 +70,7 @@ async function testURL(url, loadFunc, endFunc) {
|
|||
await SpecialPowers.spawn(
|
||||
browser,
|
||||
[{ isRemote: gMultiProcessBrowser }],
|
||||
async function (arg) {
|
||||
async function () {
|
||||
Assert.equal(
|
||||
Services.focus.focusedElement,
|
||||
null,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
const TEST_URL = `${TEST_BASE_URL}file_urlbar_edit_dos.html`;
|
||||
|
||||
async function checkURLBarValueStays(browser) {
|
||||
async function checkURLBarValueStays() {
|
||||
gURLBar.select();
|
||||
EventUtils.sendString("a");
|
||||
is(gURLBar.value, "a", "URL bar value should match after sending a key");
|
||||
|
|
|
@ -36,7 +36,7 @@ add_setup(async function () {
|
|||
async function selectSettings(win, activateFn) {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser: win.gBrowser, url: "about:blank" },
|
||||
async browser => {
|
||||
async () => {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window: win,
|
||||
value: "example.com",
|
||||
|
|
|
@ -67,7 +67,7 @@ var gWebProgressListener = {
|
|||
// onSecurityChange: function() {},
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
|
||||
onLocationChange(aWebProgress, aRequest, aLocation) {
|
||||
if (!aRequest) {
|
||||
// This is bug 673752, or maybe initial "about:blank".
|
||||
return;
|
||||
|
|
|
@ -186,7 +186,7 @@ add_task(async function test_searchMode_removeRestyledHistory() {
|
|||
let url = `https://example.com/?q=${query}bar`;
|
||||
await PlacesTestUtils.addVisits(url);
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: query,
|
||||
|
|
|
@ -48,7 +48,7 @@ add_task(async function test() {
|
|||
let provider = new UrlbarTestUtils.TestProvider({
|
||||
results,
|
||||
priority: 1,
|
||||
onSelection: (result, element) => {
|
||||
onSelection: () => {
|
||||
selectionCount++;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@ add_task(async function test_receive_punycode_result() {
|
|||
addCallback(this, result);
|
||||
}
|
||||
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(_result, _idsByName) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ async function test_window(win) {
|
|||
// we just wait for the expected currentURI value.
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser: win.gBrowser, url, waitForLoad: false },
|
||||
async browser => {
|
||||
async () => {
|
||||
await TestUtils.waitForCondition(
|
||||
() => win.gBrowser.currentURI.spec == url,
|
||||
"Ensure we're on the expected page"
|
||||
|
|
|
@ -7,7 +7,7 @@ add_task(async function () {
|
|||
gBrowser,
|
||||
url: "http://example.com",
|
||||
},
|
||||
async function (browser) {
|
||||
async function () {
|
||||
let originalValue = gURLBar.value;
|
||||
let tab = gBrowser.selectedTab;
|
||||
info("Put a typed value.");
|
||||
|
|
|
@ -196,7 +196,7 @@ add_task(async function escapeOnInitialPage() {
|
|||
add_task(async function escapeOnBrowsingPage() {
|
||||
info("Tests the indicator's interaction with the ESC key on browsing page");
|
||||
|
||||
await BrowserTestUtils.withNewTab("http://example.com", async browser => {
|
||||
await BrowserTestUtils.withNewTab("http://example.com", async () => {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: TEST_QUERY,
|
||||
|
@ -355,7 +355,7 @@ add_task(async function menubar_item() {
|
|||
// Tests that entering search mode invalidates pageproxystate and that
|
||||
// pageproxystate remains invalid after exiting search mode.
|
||||
add_task(async function invalidate_pageproxystate() {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () => {
|
||||
EventUtils.synthesizeMouseAtCenter(gURLBar.inputField, {});
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ add_task(async function test() {
|
|||
set: [["browser.search.suggest.enabled", false]],
|
||||
});
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:robots", async browser => {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async () => {
|
||||
// View open, with string.
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
|
@ -69,7 +69,7 @@ add_task(async function test() {
|
|||
Assert.ok(!BrowserTestUtils.isVisible(labelBox));
|
||||
});
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:robots", async browser => {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async () => {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: "test",
|
||||
|
|
|
@ -74,7 +74,7 @@ add_setup(async function () {
|
|||
});
|
||||
|
||||
add_task(async function emptySearch() {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.urlbar.update2.emptySearchBehavior", 2]],
|
||||
});
|
||||
|
@ -109,7 +109,7 @@ add_task(async function emptySearch_withRestyledHistory() {
|
|||
// Can be restyled but does not dupe form history.
|
||||
"http://mochi.test:8888/?terms=ciao",
|
||||
]);
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.urlbar.update2.emptySearchBehavior", 2]],
|
||||
});
|
||||
|
@ -162,7 +162,7 @@ add_task(async function emptySearch_withRestyledHistory_noSearchHistory() {
|
|||
// Can be restyled but does not dupe form history.
|
||||
"http://mochi.test:8888/?terms=ciao",
|
||||
]);
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["browser.urlbar.update2.emptySearchBehavior", 2],
|
||||
|
@ -204,7 +204,7 @@ add_task(async function emptySearch_behavior() {
|
|||
// URLs with the same host as the search engine.
|
||||
await PlacesTestUtils.addVisits([`http://mochi.test/`]);
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.urlbar.update2.emptySearchBehavior", 0]],
|
||||
});
|
||||
|
@ -245,7 +245,7 @@ add_task(async function emptySearch_behavior() {
|
|||
await SpecialPowers.popPrefEnv();
|
||||
});
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.urlbar.update2.emptySearchBehavior", 1]],
|
||||
});
|
||||
|
@ -269,7 +269,7 @@ add_task(async function emptySearch_behavior() {
|
|||
add_task(async function emptySearch_local() {
|
||||
await PlacesTestUtils.addVisits([`http://mochi.test/`]);
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.urlbar.update2.emptySearchBehavior", 0]],
|
||||
});
|
||||
|
@ -300,7 +300,7 @@ add_task(async function emptySearch_local() {
|
|||
});
|
||||
|
||||
add_task(async function nonEmptySearch() {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
let query = "hello";
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
|
@ -348,7 +348,7 @@ add_task(async function nonEmptySearch() {
|
|||
});
|
||||
|
||||
add_task(async function nonEmptySearch_nonMatching() {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
let query = "ciao";
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
|
@ -422,7 +422,7 @@ add_task(async function nonEmptySearch_withHistory() {
|
|||
};
|
||||
}
|
||||
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
value: query,
|
||||
|
@ -520,7 +520,7 @@ add_task(async function nonEmptySearch_withHistory() {
|
|||
});
|
||||
|
||||
add_task(async function nonEmptySearch_url() {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function (browser) {
|
||||
await BrowserTestUtils.withNewTab("about:robots", async function () {
|
||||
let query = "http://www.example.com/";
|
||||
await UrlbarTestUtils.promiseAutocompleteResultPopup({
|
||||
window,
|
||||
|
|
|
@ -62,7 +62,7 @@ async function runURLBarSearchTest({
|
|||
for (let i = 0; i < setValueFns.length; ++i) {
|
||||
await setValueFns[i](valueToOpen);
|
||||
let topic = "uri-fixup-check-dns";
|
||||
let observer = (aSubject, aTopicInner, aData) => {
|
||||
let observer = (aSubject, aTopicInner) => {
|
||||
if (aTopicInner == topic) {
|
||||
gDNSResolved = true;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ function get_test_function_for_localhost_with_hostname(
|
|||
gBrowser: win.gBrowser,
|
||||
url: "about:blank",
|
||||
},
|
||||
browser =>
|
||||
() =>
|
||||
runURLBarSearchTest({
|
||||
valueToOpen: hostName,
|
||||
expectSearch: true,
|
||||
|
@ -268,7 +268,7 @@ function get_test_function_for_localhost_with_hostname(
|
|||
gBrowser: win.gBrowser,
|
||||
url: "about:blank",
|
||||
},
|
||||
browser =>
|
||||
() =>
|
||||
runURLBarSearchTest({
|
||||
valueToOpen: hostName,
|
||||
expectSearch: true,
|
||||
|
@ -289,7 +289,7 @@ function get_test_function_for_localhost_with_hostname(
|
|||
gBrowser: win.gBrowser,
|
||||
url: "about:blank",
|
||||
},
|
||||
browser =>
|
||||
() =>
|
||||
runURLBarSearchTest({
|
||||
valueToOpen: hostName,
|
||||
expectSearch: isPrivate,
|
||||
|
@ -325,7 +325,7 @@ add_task(async function test_dnsResolveSingleWordsAfterSearch() {
|
|||
gBrowser,
|
||||
url: "about:blank",
|
||||
},
|
||||
browser =>
|
||||
() =>
|
||||
runURLBarSearchTest({
|
||||
valueToOpen: "localhost",
|
||||
expectSearch: true,
|
||||
|
|
|
@ -258,7 +258,7 @@ add_task(async function staleReplacedWithFresh() {
|
|||
// test2
|
||||
// test1
|
||||
let mutationPromise = new Promise(resolve => {
|
||||
let observer = new MutationObserver(mutations => {
|
||||
let observer = new MutationObserver(() => {
|
||||
let row = UrlbarTestUtils.getRowAt(window, maxResults - 2);
|
||||
if (row && row._elements.get("title").textContent == "test2") {
|
||||
observer.disconnect();
|
||||
|
|
|
@ -206,7 +206,7 @@ function promiseEngine(expectedData, expectedEngineName) {
|
|||
expectedEngineName == engine.wrappedJSObject.name
|
||||
);
|
||||
}
|
||||
).then(([engine, data]) => engine);
|
||||
).then(([engine]) => engine);
|
||||
}
|
||||
|
||||
add_task(async function shortcuts_without_other_engines() {
|
||||
|
|
|
@ -57,7 +57,7 @@ class SecurityObserver {
|
|||
this.output = output;
|
||||
}
|
||||
|
||||
onHandshakeDone(socket, status) {
|
||||
onHandshakeDone() {
|
||||
info("TLS handshake done");
|
||||
handshakeDone = true;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ async function typeAndSubmitAndStop(url) {
|
|||
// urlbar value has been updated, add our own progress listener here.
|
||||
let progressPromise = new Promise(resolve => {
|
||||
let listener = {
|
||||
onStateChange(browser, webProgress, request, stateFlags, status) {
|
||||
onStateChange(browser, webProgress, request, stateFlags) {
|
||||
if (
|
||||
webProgress.isTopLevel &&
|
||||
stateFlags & Ci.nsIWebProgressListener.STATE_STOP
|
||||
|
|
|
@ -112,7 +112,7 @@ async function testMenuItemDisabled(url, prefEnabled, selection) {
|
|||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["privacy.query_stripping.strip_on_share.enabled", prefEnabled]],
|
||||
});
|
||||
await BrowserTestUtils.withNewTab(url, async function (browser) {
|
||||
await BrowserTestUtils.withNewTab(url, async function () {
|
||||
gURLBar.focus();
|
||||
if (selection) {
|
||||
//select only part of the url
|
||||
|
@ -175,7 +175,7 @@ async function testMenuItemEnabled({
|
|||
await listService.testSetList(testJson);
|
||||
}
|
||||
|
||||
await BrowserTestUtils.withNewTab(validUrl, async function (browser) {
|
||||
await BrowserTestUtils.withNewTab(validUrl, async function () {
|
||||
gURLBar.focus();
|
||||
if (selectWholeUrl) {
|
||||
gURLBar.select();
|
||||
|
|
|
@ -80,7 +80,7 @@ add_task(async function testMultiQueryParams() {
|
|||
});
|
||||
|
||||
async function testStripOnShare(validUrl, strippedUrl) {
|
||||
await BrowserTestUtils.withNewTab(validUrl, async function (browser) {
|
||||
await BrowserTestUtils.withNewTab(validUrl, async function () {
|
||||
gURLBar.focus();
|
||||
gURLBar.select();
|
||||
let menuitem = await promiseContextualMenuitem("strip-on-share");
|
||||
|
|
|
@ -54,7 +54,7 @@ add_task(async function test_switchtab_override() {
|
|||
info("Override switch-to-tab");
|
||||
let deferred = Promise.withResolvers();
|
||||
// In case of failure this would switch tab.
|
||||
let onTabSelect = event => {
|
||||
let onTabSelect = () => {
|
||||
deferred.reject(new Error("Should have overridden switch to tab"));
|
||||
};
|
||||
gBrowser.tabContainer.addEventListener("TabSelect", onTabSelect);
|
||||
|
|
|
@ -138,7 +138,7 @@ function loadTab(tab, url) {
|
|||
// Because adding visits is async, we will not be notified immediately.
|
||||
let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
|
||||
let visited = new Promise(resolve => {
|
||||
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
|
||||
Services.obs.addObserver(function observer(aSubject, aTopic) {
|
||||
if (url != aSubject.QueryInterface(Ci.nsIURI).spec) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -284,14 +284,14 @@ add_task(async function tab_key_race() {
|
|||
get type() {
|
||||
return UrlbarUtils.PROVIDER_TYPE.PROFILE;
|
||||
}
|
||||
isActive(context) {
|
||||
isActive(_context) {
|
||||
executeSoon(resolve);
|
||||
return false;
|
||||
}
|
||||
isRestricting(context) {
|
||||
isRestricting(_context) {
|
||||
return false;
|
||||
}
|
||||
async startQuery(context, addCallback) {
|
||||
async startQuery(_context, _addCallback) {
|
||||
// Nothing to do.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class TestProvider extends UrlbarTestUtils.TestProvider {
|
|||
});
|
||||
}
|
||||
|
||||
getViewUpdate(result, idsByName) {
|
||||
getViewUpdate(_result, _idsByName) {
|
||||
return {
|
||||
title: {
|
||||
textContent: "This is a dynamic result.",
|
||||
|
|
|
@ -115,10 +115,10 @@ class TipProvider extends UrlbarProvider {
|
|||
get type() {
|
||||
return UrlbarUtils.PROVIDER_TYPE.PROFILE;
|
||||
}
|
||||
isActive(context) {
|
||||
isActive(_context) {
|
||||
return true;
|
||||
}
|
||||
getPriority(context) {
|
||||
getPriority(_context) {
|
||||
return 1;
|
||||
}
|
||||
async startQuery(context, addCallback) {
|
||||
|
|
|
@ -90,7 +90,7 @@ add_task(async function () {
|
|||
}
|
||||
|
||||
function urlbarBackspace(removeAll) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise(resolve => {
|
||||
gBrowser.selectedBrowser.focus();
|
||||
gURLBar.addEventListener(
|
||||
"input",
|
||||
|
|
|
@ -25,7 +25,7 @@ add_task(async function () {
|
|||
let firstSelectedElement;
|
||||
let delayResultsPromise = new Promise(resolve => {
|
||||
gURLBar.controller.addQueryListener({
|
||||
async onQueryResults(queryContext) {
|
||||
async onQueryResults() {
|
||||
Assert.ok(!receivedResults, "Should execute only once");
|
||||
gURLBar.controller.removeQueryListener(this);
|
||||
receivedResults = true;
|
||||
|
|
|
@ -67,7 +67,7 @@ function waitForLoadStartOrTimeout(win = window, timeoutMs = 1000) {
|
|||
return Promise.race([
|
||||
new Promise(resolve => {
|
||||
listener = {
|
||||
onStateChange(browser, webprogress, request, flags, status) {
|
||||
onStateChange(browser, webprogress, request, flags) {
|
||||
if (flags & Ci.nsIWebProgressListener.STATE_START) {
|
||||
resolve(request.QueryInterface(Ci.nsIChannel).URI);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ add_setup(async function () {
|
|||
});
|
||||
|
||||
add_task(async function tip_persist() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await showPersistSearchTip("test");
|
||||
gURLBar.focus();
|
||||
await UrlbarTestUtils.promisePopupClose(window, () => {
|
||||
|
|
|
@ -22,7 +22,7 @@ class NoResponseTestProvider extends UrlbarTestUtils.TestProvider {
|
|||
return UrlbarUtils.PROVIDER_TYPE.HEURISTIC;
|
||||
}
|
||||
|
||||
async startQuery(context, addCallback) {
|
||||
async startQuery(_context, _addCallback) {
|
||||
await this.#deferred.promise;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ add_task(async function engagement_before_showing_results() {
|
|||
};
|
||||
registerCleanupFunction(cleanup);
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
// Try to show the results.
|
||||
await UrlbarTestUtils.inputIntoURLBar(window, "exam");
|
||||
|
||||
|
@ -156,7 +156,7 @@ add_task(async function engagement_after_closing_results() {
|
|||
];
|
||||
|
||||
for (const trigger of TRIGGERS) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("test");
|
||||
await UrlbarTestUtils.promisePopupClose(window, () => {
|
||||
trigger();
|
||||
|
@ -186,7 +186,7 @@ add_task(async function engagement_after_closing_results() {
|
|||
});
|
||||
|
||||
add_task(async function enter_to_reload_current_url() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
// Open a URL once.
|
||||
await openPopup("https://example.com");
|
||||
await doEnter();
|
||||
|
|
|
@ -247,13 +247,13 @@ add_task(async function always_empty_if_drop_go() {
|
|||
},
|
||||
];
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doDropAndGo("example.com");
|
||||
|
||||
assertEngagementTelemetry(expected);
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
// Open the results view once.
|
||||
await showResultByArrowDown();
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
|
@ -274,13 +274,13 @@ add_task(async function always_empty_if_paste_go() {
|
|||
},
|
||||
];
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doPasteAndGo("example.com");
|
||||
|
||||
assertEngagementTelemetry(expected);
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
// Open the results view once.
|
||||
await showResultByArrowDown();
|
||||
await UrlbarTestUtils.promisePopupClose(window);
|
||||
|
|
|
@ -35,13 +35,13 @@ add_task(async function typed() {
|
|||
});
|
||||
|
||||
add_task(async function dropped() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doDropAndGo("example.com");
|
||||
|
||||
assertEngagementTelemetry([{ interaction: "dropped" }]);
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await showResultByArrowDown();
|
||||
await doDropAndGo("example.com");
|
||||
|
||||
|
@ -60,13 +60,13 @@ add_task(async function pasted() {
|
|||
assert: () => assertEngagementTelemetry([{ interaction: "pasted" }]),
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doPasteAndGo("www.example.com");
|
||||
|
||||
assertEngagementTelemetry([{ interaction: "pasted" }]);
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await showResultByArrowDown();
|
||||
await doPasteAndGo("www.example.com");
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ add_setup(async function () {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_autofill_about() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("about:about");
|
||||
await doEnter();
|
||||
|
||||
|
@ -44,7 +44,7 @@ add_task(async function selected_result_autofill_adaptive() {
|
|||
set: [["browser.urlbar.autoFill.adaptiveHistory.enabled", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesTestUtils.addVisits("https://example.com/test");
|
||||
await UrlbarUtils.addToInputHistory("https://example.com/test", "exa");
|
||||
await openPopup("exa");
|
||||
|
@ -65,7 +65,7 @@ add_task(async function selected_result_autofill_adaptive() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_autofill_origin() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesTestUtils.addVisits("https://example.com/test");
|
||||
await PlacesFrecencyRecalculator.recalculateAnyOutdatedFrecencies();
|
||||
await openPopup("exa");
|
||||
|
@ -84,7 +84,7 @@ add_task(async function selected_result_autofill_origin() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_autofill_url() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesTestUtils.addVisits("https://example.com/test");
|
||||
await PlacesFrecencyRecalculator.recalculateAnyOutdatedFrecencies();
|
||||
await openPopup("https://example.com/test");
|
||||
|
@ -103,7 +103,7 @@ add_task(async function selected_result_autofill_url() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_bookmark() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
url: "https://example.com/bookmark",
|
||||
|
@ -131,7 +131,7 @@ add_task(async function selected_result_history() {
|
|||
set: [["browser.urlbar.autoFill", false]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesTestUtils.addVisits("https://example.com/test");
|
||||
|
||||
await openPopup("example");
|
||||
|
@ -153,7 +153,7 @@ add_task(async function selected_result_history() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_keyword() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesUtils.keywords.insert({
|
||||
keyword: "keyword",
|
||||
url: "https://example.com/?q=%s",
|
||||
|
@ -177,7 +177,7 @@ add_task(async function selected_result_keyword() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_search_engine() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
await doEnter();
|
||||
|
||||
|
@ -201,7 +201,7 @@ add_task(async function selected_result_search_suggest() {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("foo");
|
||||
await selectRowByURL("http://mochi.test:8888/?terms=foofoo");
|
||||
await doEnter();
|
||||
|
@ -228,7 +228,7 @@ add_task(async function selected_result_search_history() {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await UrlbarTestUtils.formHistory.add(["foofoo", "foobar"]);
|
||||
|
||||
await openPopup("foo");
|
||||
|
@ -250,7 +250,7 @@ add_task(async function selected_result_search_history() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_url() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("https://example.com/");
|
||||
await doEnter();
|
||||
|
||||
|
@ -267,7 +267,7 @@ add_task(async function selected_result_url() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_action() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await showResultByArrowDown();
|
||||
await selectRowByProvider("quickactions");
|
||||
const onLoad = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
|
||||
|
@ -289,7 +289,7 @@ add_task(async function selected_result_action() {
|
|||
add_task(async function selected_result_tab() {
|
||||
const tab = BrowserTestUtils.addTab(gBrowser, "https://example.com/");
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("example");
|
||||
await selectRowByProvider("Places");
|
||||
EventUtils.synthesizeKey("KEY_Enter");
|
||||
|
@ -312,7 +312,7 @@ add_task(async function selected_result_tab() {
|
|||
add_task(async function selected_result_remote_tab() {
|
||||
const remoteTab = await loadRemoteTab("https://example.com");
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("example");
|
||||
await selectRowByProvider("RemoteTabs");
|
||||
await doEnter();
|
||||
|
@ -335,7 +335,7 @@ add_task(async function selected_result_addon() {
|
|||
const addon = loadOmniboxAddon({ keyword: "omni" });
|
||||
await addon.startup();
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("omni test");
|
||||
await doEnter();
|
||||
|
||||
|
@ -363,7 +363,7 @@ add_task(async function selected_result_tab_to_search() {
|
|||
search_url: "https://mozengine/",
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
await PlacesTestUtils.addVisits(["https://mozengine/"]);
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ add_task(async function selected_result_tab_to_search() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_top_site() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await addTopSites("https://example.com/");
|
||||
await showResultByArrowDown();
|
||||
await selectRowByURL("https://example.com/");
|
||||
|
@ -412,7 +412,7 @@ add_task(async function selected_result_calc() {
|
|||
set: [["browser.urlbar.suggest.calculator", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("8*8");
|
||||
await selectRowByProvider("calculator");
|
||||
await SimpleTest.promiseClipboardChange("64", () => {
|
||||
|
@ -444,7 +444,7 @@ add_task(async function selected_result_clipboard() {
|
|||
"https://example.com/selected_result_clipboard"
|
||||
);
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("");
|
||||
await selectRowByProvider("UrlbarProviderClipboard");
|
||||
await doEnter();
|
||||
|
@ -470,7 +470,7 @@ add_task(async function selected_result_unit() {
|
|||
set: [["browser.urlbar.unitConversion.enabled", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("1m to cm");
|
||||
await selectRowByProvider("UnitConversion");
|
||||
await SimpleTest.promiseClipboardChange("100 cm", () => {
|
||||
|
@ -496,7 +496,7 @@ add_task(async function selected_result_site_specific_contextual_search() {
|
|||
set: [["browser.urlbar.contextualSearch.enabled", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
const extension = await SearchTestUtils.installSearchExtension(
|
||||
{
|
||||
name: "Contextual",
|
||||
|
@ -540,7 +540,7 @@ add_task(async function selected_result_rs_adm_sponsored() {
|
|||
prefs: [["quicksuggest.rustEnabled", false]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("sponsored");
|
||||
await selectRowByURL("https://example.com/sponsored");
|
||||
await doEnter();
|
||||
|
@ -564,7 +564,7 @@ add_task(async function selected_result_rs_adm_nonsponsored() {
|
|||
prefs: [["quicksuggest.rustEnabled", false]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("nonsponsored");
|
||||
await selectRowByURL("https://example.com/nonsponsored");
|
||||
await doEnter();
|
||||
|
@ -594,13 +594,13 @@ add_task(async function selected_result_input_field() {
|
|||
},
|
||||
];
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doDropAndGo("example.com");
|
||||
|
||||
assertEngagementTelemetry(expected);
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doPasteAndGo("example.com");
|
||||
|
||||
assertEngagementTelemetry(expected);
|
||||
|
@ -618,7 +618,7 @@ add_task(async function selected_result_weather() {
|
|||
let provider = UrlbarPrefs.get("quickSuggestRustEnabled")
|
||||
? "UrlbarProviderQuickSuggest"
|
||||
: "Weather";
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup(MerinoTestUtils.WEATHER_KEYWORD);
|
||||
await selectRowByProvider(provider);
|
||||
await doEnter();
|
||||
|
@ -653,7 +653,7 @@ add_task(async function selected_result_navigational() {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("only match the Merino suggestion");
|
||||
await selectRowByProvider("UrlbarProviderQuickSuggest");
|
||||
await doEnter();
|
||||
|
@ -688,7 +688,7 @@ add_task(async function selected_result_dynamic_wikipedia() {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("only match the Merino suggestion");
|
||||
await selectRowByProvider("UrlbarProviderQuickSuggest");
|
||||
await doEnter();
|
||||
|
@ -708,7 +708,7 @@ add_task(async function selected_result_dynamic_wikipedia() {
|
|||
});
|
||||
|
||||
add_task(async function selected_result_search_shortcut_button() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
const oneOffSearchButtons = UrlbarTestUtils.getOneOffSearchButtons(window);
|
||||
await openPopup("x");
|
||||
Assert.ok(!oneOffSearchButtons.selectedButton);
|
||||
|
@ -780,7 +780,7 @@ add_task(async function selected_result_trending() {
|
|||
},
|
||||
]);
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("");
|
||||
await selectRowByProvider("SearchSuggestions");
|
||||
await doEnter();
|
||||
|
@ -847,7 +847,7 @@ add_task(async function selected_result_trending_rich() {
|
|||
},
|
||||
]);
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("");
|
||||
await selectRowByProvider("SearchSuggestions");
|
||||
await doEnter();
|
||||
|
@ -905,7 +905,7 @@ add_task(async function selected_result_addons() {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("only match the Merino suggestion");
|
||||
await selectRowByProvider("UrlbarProviderQuickSuggest");
|
||||
await doEnter();
|
||||
|
@ -930,7 +930,7 @@ add_task(async function selected_result_rust_adm_sponsored() {
|
|||
prefs: [["quicksuggest.rustEnabled", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("sponsored");
|
||||
await selectRowByURL("https://example.com/sponsored");
|
||||
await doEnter();
|
||||
|
@ -954,7 +954,7 @@ add_task(async function selected_result_rust_adm_nonsponsored() {
|
|||
prefs: [["quicksuggest.rustEnabled", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("nonsponsored");
|
||||
await selectRowByURL("https://example.com/nonsponsored");
|
||||
await doEnter();
|
||||
|
|
|
@ -69,7 +69,7 @@ add_task(async function selected_result_tip() {
|
|||
});
|
||||
UrlbarProvidersManager.registerProvider(provider);
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("example");
|
||||
await selectRowByType(type);
|
||||
EventUtils.synthesizeKey("VK_RETURN");
|
||||
|
@ -159,7 +159,7 @@ add_task(async function selected_result_intervention_update() {
|
|||
});
|
||||
|
||||
async function doInterventionTest(keyword, type, dialog, expectedTelemetry) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup(keyword);
|
||||
await selectRowByType(type);
|
||||
const onDialog = BrowserTestUtils.promiseAlertDialog("cancel", dialog, {
|
||||
|
|
|
@ -14,7 +14,7 @@ add_setup(async function () {
|
|||
});
|
||||
|
||||
add_task(async function engagement_type_click() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
await doClick();
|
||||
|
||||
|
@ -23,7 +23,7 @@ add_task(async function engagement_type_click() {
|
|||
});
|
||||
|
||||
add_task(async function engagement_type_enter() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
await doEnter();
|
||||
|
||||
|
@ -32,7 +32,7 @@ add_task(async function engagement_type_enter() {
|
|||
});
|
||||
|
||||
add_task(async function engagement_type_go_button() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
EventUtils.synthesizeMouseAtCenter(gURLBar.goButton, {});
|
||||
|
||||
|
@ -41,7 +41,7 @@ add_task(async function engagement_type_go_button() {
|
|||
});
|
||||
|
||||
add_task(async function engagement_type_drop_go() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doDropAndGo("example.com");
|
||||
|
||||
assertEngagementTelemetry([{ engagement_type: "drop_go" }]);
|
||||
|
@ -49,7 +49,7 @@ add_task(async function engagement_type_drop_go() {
|
|||
});
|
||||
|
||||
add_task(async function engagement_type_paste_go() {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doPasteAndGo("www.example.com");
|
||||
|
||||
assertEngagementTelemetry([{ engagement_type: "paste_go" }]);
|
||||
|
@ -59,7 +59,7 @@ add_task(async function engagement_type_paste_go() {
|
|||
add_task(async function engagement_type_dismiss() {
|
||||
const cleanupQuickSuggest = await ensureQuickSuggestInit();
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("sponsored");
|
||||
|
||||
const originalResultCount = UrlbarTestUtils.getResultCount(window);
|
||||
|
@ -84,7 +84,7 @@ add_task(async function engagement_type_dismiss() {
|
|||
]);
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("sponsored");
|
||||
|
||||
const originalResultCount = UrlbarTestUtils.getResultCount(window);
|
||||
|
@ -103,7 +103,7 @@ add_task(async function engagement_type_dismiss() {
|
|||
add_task(async function engagement_type_help() {
|
||||
const cleanupQuickSuggest = await ensureQuickSuggestInit();
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("sponsored");
|
||||
await selectRowByURL("https://example.com/sponsored");
|
||||
const onTabOpened = BrowserTestUtils.waitForNewTab(gBrowser);
|
||||
|
|
|
@ -523,7 +523,7 @@ class TestProvider extends UrlbarTestUtils.TestProvider {
|
|||
function promiseLastRowAppended(predicate) {
|
||||
return new Promise(resolve => {
|
||||
let rows = UrlbarTestUtils.getResultsContainer(window);
|
||||
let observer = new MutationObserver(mutations => {
|
||||
let observer = new MutationObserver(() => {
|
||||
let lastRow = rows.children[rows.children.length - 1];
|
||||
info(
|
||||
"Observed mutation, lastRow.result is: " +
|
||||
|
|
|
@ -11,7 +11,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
});
|
||||
|
||||
async function doHeuristicsTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
|
||||
await trigger();
|
||||
|
@ -24,7 +24,7 @@ async function doAdaptiveHistoryTest({ trigger, assert }) {
|
|||
set: [["browser.urlbar.autoFill", false]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesTestUtils.addVisits(["https://example.com/test"]);
|
||||
await UrlbarUtils.addToInputHistory("https://example.com/test", "examp");
|
||||
|
||||
|
@ -46,7 +46,7 @@ async function doSearchHistoryTest({ trigger, assert }) {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await UrlbarTestUtils.formHistory.add(["foofoo", "foobar"]);
|
||||
|
||||
await openPopup("foo");
|
||||
|
@ -64,7 +64,7 @@ async function doRecentSearchTest({ trigger, assert }) {
|
|||
set: [["browser.urlbar.recentsearches.featureGate", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await UrlbarTestUtils.formHistory.add([
|
||||
{ value: "foofoo", source: Services.search.defaultEngine.name },
|
||||
]);
|
||||
|
@ -87,7 +87,7 @@ async function doSearchSuggestTest({ trigger, assert }) {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("foo");
|
||||
await selectRowByURL("http://mochi.test:8888/?terms=foofoo");
|
||||
|
||||
|
@ -101,7 +101,7 @@ async function doSearchSuggestTest({ trigger, assert }) {
|
|||
async function doTailSearchSuggestTest({ trigger, assert }) {
|
||||
const cleanup = await _useTailSuggestionsEngine();
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("hello");
|
||||
await selectRowByProvider("SearchSuggestions");
|
||||
|
||||
|
@ -127,7 +127,7 @@ async function doTopPickTest({ trigger, assert }) {
|
|||
],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("navigational");
|
||||
await selectRowByURL("https://example.com/navigational-suggestion");
|
||||
|
||||
|
@ -139,7 +139,7 @@ async function doTopPickTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doTopSiteTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await addTopSites("https://example.com/");
|
||||
|
||||
await showResultByArrowDown();
|
||||
|
@ -158,7 +158,7 @@ async function doClipboardTest({ trigger, assert }) {
|
|||
],
|
||||
});
|
||||
SpecialPowers.clipboardCopyString("https://example.com/clipboard");
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await showResultByArrowDown();
|
||||
await selectRowByURL("https://example.com/clipboard");
|
||||
|
||||
|
@ -173,7 +173,7 @@ async function doClipboardTest({ trigger, assert }) {
|
|||
async function doRemoteTabTest({ trigger, assert }) {
|
||||
const remoteTab = await loadRemoteTab("https://example.com");
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("example");
|
||||
await selectRowByProvider("RemoteTabs");
|
||||
|
||||
|
@ -188,7 +188,7 @@ async function doAddonTest({ trigger, assert }) {
|
|||
const addon = loadOmniboxAddon({ keyword: "omni" });
|
||||
await addon.startup();
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("omni test");
|
||||
|
||||
await trigger();
|
||||
|
@ -199,7 +199,7 @@ async function doAddonTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doGeneralBookmarkTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
url: "https://example.com/bookmark",
|
||||
|
@ -219,7 +219,7 @@ async function doGeneralHistoryTest({ trigger, assert }) {
|
|||
set: [["browser.urlbar.autoFill", false]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesTestUtils.addVisits("https://example.com/test");
|
||||
|
||||
await openPopup("example");
|
||||
|
@ -235,7 +235,7 @@ async function doGeneralHistoryTest({ trigger, assert }) {
|
|||
async function doSuggestTest({ trigger, assert }) {
|
||||
const cleanupQuickSuggest = await ensureQuickSuggestInit();
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("nonsponsored");
|
||||
await selectRowByURL("https://example.com/nonsponsored");
|
||||
|
||||
|
@ -251,7 +251,7 @@ async function doAboutPageTest({ trigger, assert }) {
|
|||
set: [["browser.urlbar.maxRichResults", 3]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("about:");
|
||||
await selectRowByURL("about:robots");
|
||||
|
||||
|
@ -267,7 +267,7 @@ async function doSuggestedIndexTest({ trigger, assert }) {
|
|||
set: [["browser.urlbar.unitConversion.enabled", true]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("1m to cm");
|
||||
await selectRowByProvider("UnitConversion");
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ ChromeUtils.defineESModuleGetters(this, {
|
|||
});
|
||||
|
||||
async function doTopsitesTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await addTopSites("https://example.com/");
|
||||
|
||||
await showResultByArrowDown();
|
||||
|
@ -120,7 +120,7 @@ async function doTopsitesSearchTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doTypedTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
|
||||
await trigger();
|
||||
|
@ -129,7 +129,7 @@ async function doTypedTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doTypedWithResultsPopupTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await showResultByArrowDown();
|
||||
EventUtils.synthesizeKey("x");
|
||||
await UrlbarTestUtils.promiseSearchComplete(window);
|
||||
|
@ -140,7 +140,7 @@ async function doTypedWithResultsPopupTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doPastedTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await doPaste("www.example.com");
|
||||
|
||||
await trigger();
|
||||
|
@ -149,7 +149,7 @@ async function doPastedTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doPastedWithResultsPopupTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await showResultByArrowDown();
|
||||
await doPaste("x");
|
||||
|
||||
|
@ -189,7 +189,7 @@ async function doReturnedRestartedRefinedTest({ trigger, assert }) {
|
|||
];
|
||||
|
||||
for (const { firstInput, secondInput, expected } of testData) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup(firstInput);
|
||||
await doBlur();
|
||||
|
||||
|
@ -210,7 +210,7 @@ async function doReturnedRestartedRefinedTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doPersistedSearchTermsTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
await doEnter();
|
||||
|
||||
|
@ -256,7 +256,7 @@ async function doPersistedSearchTermsRestartedRefinedTest({
|
|||
];
|
||||
|
||||
for (const { firstInput, secondInput, expected } of testData) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup(firstInput);
|
||||
await doEnter();
|
||||
|
||||
|
@ -311,7 +311,7 @@ async function doPersistedSearchTermsRestartedRefinedViaAbandonmentTest({
|
|||
];
|
||||
|
||||
for (const { firstInput, secondInput, expected } of testData) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("any search");
|
||||
await doEnter();
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
async function doNCharsTest({ trigger, assert }) {
|
||||
for (const input of ["x", "xx", "xx x", "xx x "]) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup(input);
|
||||
|
||||
await trigger();
|
||||
|
@ -17,7 +17,7 @@ async function doNCharsTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doNCharsWithOverMaxTextLengthCharsTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
let input = "";
|
||||
for (let i = 0; i < UrlbarUtils.MAX_TEXT_LENGTH * 2; i++) {
|
||||
input += "x";
|
||||
|
@ -31,7 +31,7 @@ async function doNCharsWithOverMaxTextLengthCharsTest({ trigger, assert }) {
|
|||
|
||||
async function doNWordsTest({ trigger, assert }) {
|
||||
for (const input of ["x", "xx", "xx x", "xx x "]) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup(input);
|
||||
|
||||
await trigger();
|
||||
|
@ -42,7 +42,7 @@ async function doNWordsTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doNWordsWithOverMaxTextLengthCharsTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
const word = "1234 ";
|
||||
let input = "";
|
||||
while (input.length < UrlbarUtils.MAX_TEXT_LENGTH * 2) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* import-globals-from head.js */
|
||||
|
||||
async function doUrlbarNewTabTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
|
||||
await trigger();
|
||||
|
@ -15,7 +15,7 @@ async function doUrlbarNewTabTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doUrlbarTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
await doEnter();
|
||||
await openPopup("y");
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* import-globals-from head.js */
|
||||
|
||||
async function doSearchEngineDefaultIdTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
info("Test with current engine");
|
||||
const defaultEngine = await Services.search.getDefault();
|
||||
|
||||
|
@ -15,7 +15,7 @@ async function doSearchEngineDefaultIdTest({ trigger, assert }) {
|
|||
await assert(defaultEngine.telemetryId);
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
info("Test with new engine");
|
||||
const defaultEngine = await Services.search.getDefault();
|
||||
const newEngineName = "NewDummyEngine";
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* import-globals-from head.js */
|
||||
|
||||
async function doNotSearchModeTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
|
||||
await trigger();
|
||||
|
@ -15,7 +15,7 @@ async function doNotSearchModeTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doSearchEngineTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("x");
|
||||
await UrlbarTestUtils.enterSearchMode(window);
|
||||
|
||||
|
@ -25,7 +25,7 @@ async function doSearchEngineTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doBookmarksTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.unfiledGuid,
|
||||
url: "https://example.com/bookmark",
|
||||
|
@ -47,7 +47,7 @@ async function doHistoryTest({ trigger, assert }) {
|
|||
set: [["browser.urlbar.autoFill", false]],
|
||||
});
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await PlacesTestUtils.addVisits("https://example.com/test");
|
||||
await openPopup("example");
|
||||
await UrlbarTestUtils.enterSearchMode(window, {
|
||||
|
@ -65,7 +65,7 @@ async function doHistoryTest({ trigger, assert }) {
|
|||
async function doTabTest({ trigger, assert }) {
|
||||
const tab = BrowserTestUtils.addTab(gBrowser, "https://example.com/");
|
||||
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("example");
|
||||
await UrlbarTestUtils.enterSearchMode(window, {
|
||||
source: UrlbarUtils.RESULT_SOURCE.TABS,
|
||||
|
@ -80,7 +80,7 @@ async function doTabTest({ trigger, assert }) {
|
|||
}
|
||||
|
||||
async function doActionsTest({ trigger, assert }) {
|
||||
await doTest(async browser => {
|
||||
await doTest(async () => {
|
||||
await openPopup("add");
|
||||
await UrlbarTestUtils.enterSearchMode(window, {
|
||||
source: UrlbarUtils.RESULT_SOURCE.ACTIONS,
|
||||
|
|
|
@ -586,7 +586,7 @@ export class RemoteSettingsServer {
|
|||
* @param {object} options.body
|
||||
* The response body, if any.
|
||||
*/
|
||||
#logResponse({ request, status, statusText, headers, body }) {
|
||||
#logResponse({ request, status, headers, body }) {
|
||||
this.#log.info(`> ${status} ${request.path}`);
|
||||
for (let [name, value] of Object.entries(headers)) {
|
||||
this.#log.debug(`${name}: ${value}`);
|
||||
|
|
|
@ -172,7 +172,7 @@ add_task(async function hiddenRow() {
|
|||
// mutation listener to the view so we can tell when the quick suggest row is
|
||||
// added.
|
||||
let mutationPromise = new Promise(resolve => {
|
||||
let observer = new MutationObserver(mutations => {
|
||||
let observer = new MutationObserver(() => {
|
||||
let rows = UrlbarTestUtils.getResultsContainer(window).children;
|
||||
for (let row of rows) {
|
||||
if (row.result.providerName == "UrlbarProviderQuickSuggest") {
|
||||
|
|
|
@ -363,10 +363,10 @@ add_task(async function onNimbusChanged() {
|
|||
// Add an observer that throws an Error and an observer that does not define
|
||||
// anything to check whether the other observers can get notifications.
|
||||
UrlbarPrefs.addObserver({
|
||||
onPrefChanged(pref) {
|
||||
onPrefChanged() {
|
||||
throw new Error("From onPrefChanged");
|
||||
},
|
||||
onNimbusChanged(pref) {
|
||||
onNimbusChanged() {
|
||||
throw new Error("From onNimbusChanged");
|
||||
},
|
||||
});
|
||||
|
@ -407,10 +407,10 @@ add_task(async function onPrefChanged() {
|
|||
// Add an observer that throws an Error and an observer that does not define
|
||||
// anything to check whether the other observers can get notifications.
|
||||
UrlbarPrefs.addObserver({
|
||||
onPrefChanged(pref) {
|
||||
onPrefChanged() {
|
||||
throw new Error("From onPrefChanged");
|
||||
},
|
||||
onNimbusChanged(pref) {
|
||||
onNimbusChanged() {
|
||||
throw new Error("From onNimbusChanged");
|
||||
},
|
||||
});
|
||||
|
|
|
@ -65,14 +65,10 @@ add_task(async function onlyEnabled_option_nomatch() {
|
|||
let domain = engine.searchUrlDomain;
|
||||
let token = domain.substr(0, 1);
|
||||
engine.hideOneOffButton = true;
|
||||
let matchedEngines = await UrlbarSearchUtils.enginesForDomainPrefix(token, {
|
||||
onlyEnabled: true,
|
||||
});
|
||||
let matchedEngines = await UrlbarSearchUtils.enginesForDomainPrefix(token);
|
||||
Assert.notEqual(matchedEngines[0].searchUrlDomain, domain);
|
||||
engine.hideOneOffButton = false;
|
||||
matchedEngines = await UrlbarSearchUtils.enginesForDomainPrefix(token, {
|
||||
onlyEnabled: true,
|
||||
});
|
||||
matchedEngines = await UrlbarSearchUtils.enginesForDomainPrefix(token);
|
||||
Assert.equal(matchedEngines[0].searchUrlDomain, domain);
|
||||
});
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ add_task(async function timerIsCancelled() {
|
|||
// Then they will be queued up in a _heuristicProvidersTimer, waiting for
|
||||
// the results from SlowProvider.
|
||||
let resultsAddedPromise = new Promise(resolve => {
|
||||
let observe = async (subject, topic, data) => {
|
||||
let observe = async () => {
|
||||
Services.obs.removeObserver(observe, "results-added");
|
||||
// Fire the second query to cancel the first.
|
||||
await controller.startQuery(secondContext);
|
||||
|
|
|
@ -205,10 +205,10 @@ add_task(async function test_filter_queryContext() {
|
|||
get type() {
|
||||
return UrlbarUtils.PROVIDER_TYPE.PROFILE;
|
||||
}
|
||||
isActive(context) {
|
||||
isActive(_context) {
|
||||
return true;
|
||||
}
|
||||
async startQuery(context, add) {
|
||||
async startQuery(_context, _add) {
|
||||
Assert.ok(false, "Provider should no be invoked");
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ add_task(async function test_filter_priority() {
|
|||
super({ priority, name: `${priority}` + namePart });
|
||||
this._shouldBeInvoked = shouldBeInvoked;
|
||||
}
|
||||
async startQuery(context, add) {
|
||||
async startQuery(_context, _add) {
|
||||
Assert.ok(this._shouldBeInvoked, `${this.name} was invoked`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ let MockClientsEngine = {
|
|||
Assert.ok(guid.endsWith("desktop") || guid.endsWith("mobile"));
|
||||
return guid.endsWith("mobile") ? "phone" : "desktop";
|
||||
},
|
||||
remoteClientExists(id) {
|
||||
remoteClientExists(_id) {
|
||||
return true;
|
||||
},
|
||||
getClientName(id) {
|
||||
|
@ -662,7 +662,7 @@ add_task(async function test_duplicate_remote_tabs() {
|
|||
let url = "http://foo.remote.com/";
|
||||
let tabs = Array(3)
|
||||
.fill(0)
|
||||
.map((e, i) => ({
|
||||
.map(() => ({
|
||||
urlHistory: [url],
|
||||
title: "A title",
|
||||
lastUsed: Math.floor(Date.now() / 1000),
|
||||
|
|
|
@ -430,7 +430,7 @@ add_task(async function remoteSuggestionsDupeSearchString() {
|
|||
add_task(async function queryIsNotASubstring() {
|
||||
Services.prefs.setBoolPref(SUGGEST_PREF, true);
|
||||
|
||||
setSuggestionsFn(searchStr => {
|
||||
setSuggestionsFn(() => {
|
||||
return ["aaa", "bbb"];
|
||||
});
|
||||
|
||||
|
@ -1550,7 +1550,7 @@ add_task(async function restrict_remote_suggestions_after_no_results() {
|
|||
// maxCharsForSearchSuggestions returns 0 results. We set it to 4 here to
|
||||
// avoid constructing a 100+ character string.
|
||||
Services.prefs.setIntPref("browser.urlbar.maxCharsForSearchSuggestions", 4);
|
||||
setSuggestionsFn(searchStr => {
|
||||
setSuggestionsFn(() => {
|
||||
return [];
|
||||
});
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче