fune/browser/components/urlbar/tests/browser-tips
Drew Willcoxon a3b0a1fd4c Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak
This removes `UrlbarProvider.pickResult()` and `blockResult()` in favor of
handling picks and dismissals through `onEngagement()`. A number of providers
use those two methods, so this revision touches a lot of files.

Handling dismissals through `onEngagement()` means `UrlbarInput.pickResult()`
can no longer tell whether a result is successfully dismissed, so it can't
remove the result anymore. (Maybe `onEngagement()` could return some value
indicating it dismissed the result, but I don't want to go down that road.)
Instead, I split `UrlbarController.handleDeleteEntry()` into two methods: a
public one that removes the result and notifies listeners, and a private one
that handles dismissing the selected result internally in
UrlbarController. Providers that have dismissable results should now implement
`onEngagement()` and call `controller.removeResult()`.

I made some other improvements to engagement handling. There's still room for
more but this patch is big enough already.

Other notable changes:

Include the engaged result in engagement notifications so providers have easy
access to it and can respond to clicks and dismissals more easily. That also
lets us stop passing `selIndex` and `provider` to `engagementEvent.record()`
since now it can compute those from the passed-in result.

Add the concept of `isSessionOngoing` to engagement notifications so providers
can tell whether an engagement ended the search session. Right now, providers
like quick suggest that record a bunch of provider-specific legacy telemetry
assume that `onEngagement()` ends the session, but that's no longer true.

Unify result buttons and result menu commands by setting
`element.dataset.command` on buttons (hopefully we can remove buttons soon, at
least the ones that aren't tip buttons)

Make sure we always notify providers on engagement even on dismissals or
when skipping legacy telemetry

Move dismissal of restyled search suggestions and history results from
`UrlbarController.handleDeleteEntry()` to the Places provider

Move dismissal of form history results from
`UrlbarController.handleDeleteEntry()` to the search suggestions provider

In the Places provider, remove the unused `_addSearchEngineMatch()` method. Also
remove the code in the "searchengine" case that creates a non-search-history
result. This code is unreached because the only time the provider creates a
"searchengine" match it also sets `isSearchHistory` to true.

In `UrlbarTestUtils.promiseAutocompleteResultPopup()`, change the default value
of the `fireInputEvent` param from false to true. This is necessary because
without a starting input event, the start event info in `engagementEvent` will
be null, so when `engagementEvent.record()` is called at the end of the
engagement, it will bail, and providers will not be notified of the engagement.
IMO true is a better default value anyway because input events will typically be
fired when the user performs a search.

Differential Revision: https://phabricator.services.mozilla.com/D174941
2023-04-13 06:03:33 +00:00
..
browser.ini Bug 1812476: Move engagement telemetry tests for tips to under engagementTelemetry folder. r=adw 2023-02-10 22:29:49 +00:00
browser_interventions.js Bug 1790020 - Hook up urlbar result menu with telementry. r=mak 2023-03-09 12:02:13 +00:00
browser_picks.js Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
browser_searchTips.js Bug 1825642 - Hide the persist search tip when a Popup is visible - r=adw 2023-04-03 03:29:55 +00:00
browser_searchTips_interaction.js Bug 1827762 - Replace UrlbarProvider.pickResult() and blockResult() with onEngagement() r=mak 2023-04-13 06:03:33 +00:00
browser_selection.js Bug 1810647 - Prepare for enable urlbar result menu in Nightly. r=mak,fluent-reviewers,flod 2023-01-23 15:54:53 +00:00
browser_updateAsk.js
browser_updateRefresh.js
browser_updateRestart.js
browser_updateWeb.js
head.js Bug 1815588 - Don't have the persist tip look selected upon load - r=adw 2023-02-10 00:44:58 +00:00
README.txt
slow-page.html

If you're running these tests and you get an error like this:

FAIL head.js import threw an exception - Error opening input stream (invalid filename?): chrome://mochitests/content/browser/toolkit/mozapps/update/tests/browser/head.js

Then run `mach test toolkit/mozapps/update/tests/browser` first.  You can
stop mach as soon as it starts the first test, but this is necessary so that
mach builds the update tests in your objdir.