This makes the browser_UsageTelemetry_urlbar*.js tests pass for the all of the
FX_URLBAR_SELECTED_RESULT_* histograms apart from the "METHOD" one which will be handled
in bug 1500476.
I have handled the recording of telemetry in the controller, as this seems a better
location than BrowserUsageTelemetry.jsm due to needing to reach into the results and obtain
specific details.
Differential Revision: https://phabricator.services.mozilla.com/D19785
--HG--
extra : moz-landing-system : lando
There are a few potential places to do this:
(1) UrlbarProviderUnifiedComplete, when it creates results
(2) UrlbarResult.payloadAndSimpleHighlights(), which UrlbarProviderUnifiedComplete calls when it creates results (and presumably other providers would call it, too)
(3) UrlbarResult._titleAndHighlights(), when it figures out what to return as the title
It's hard to do it in (3) because in that location, we don't know the user's search string, so we don't know what to highlight. (1) is possible, but it would probably be nice for other providers and all result types to benefit from this? So I chose (2), and also because UrlbarResult.payloadAndSimpleHighlights() is just an easy place to do it since UrlbarProviderUnifiedComplete calls it for each result it creates.
The actual code to get the domain is copied from autocomplete.xml more or less.
Differential Revision: https://phabricator.services.mozilla.com/D18642
--HG--
extra : moz-landing-system : lando
We should replace the context.autofillValue property with a result.autofill property. When the view selects results, it already notifies the input about it by calling input.setValueFromResult(). So we can modify setValueFromResult to check for the presence of result.autofill and thereby get autofill "for free".
result.autofill is an object: { value, selectionStart, selectionEnd }
This is going to help me implement bug 1521702.
One potentially cool thing about doing autofill this way is that any result can now trigger autofill, not only the heuristic result, and do it easily. Of course the user isn't typing when they select a non-heuristic result, so it's probably not fair to call that "autofill", but the result can trigger the selection aspect of autofill. As one example, that might be interesting for search suggestions: Type "foo", key down to the "foobar" suggestion, and the "bar" substring is automatically selected.
Differential Revision: https://phabricator.services.mozilla.com/D18618
--HG--
extra : moz-landing-system : lando
We should replace the context.autofillValue property with a result.autofill property. When the view selects results, it already notifies the input about it by calling input.setValueFromResult(). So we can modify setValueFromResult to check for the presence of result.autofill and thereby get autofill "for free". (The one place where the view doesn't call input.setValueFromResult() when a result is selected is when it selects the preselected result, so this patch adds that.)
result.autofill is an object: { value, selectionStart, selectionEnd }
This is going to help me implement bug 1521702.
One potentially cool thing about doing autofill this way is that any result can now trigger autofill, not only the heuristic result, and do it easily. Of course the user isn't typing when they select a non-heuristic result, so it's probably not fair to call that "autofill", but the result can trigger the selection aspect of autofill. As one example, that might be interesting for search suggestions: Type "foo", key down to the "foobar" suggestion, and the "bar" substring is automatically selected.
Differential Revision: https://phabricator.services.mozilla.com/D18618
--HG--
extra : moz-landing-system : lando
This is a rollup of all the patches that have landed on the cedar project branch:
891252fdd0
Bug 1492475 - Part 1: Migrate most, if not all nsSearchService consumers to use async APIs. r=florian
79b2eb2367
Bug 1492475 - Part 2: Move nsIBrowserSearchService.idl to toolkit/components/search/nsISearchService.idl and update references. r=florian
a947d3cdf0
Bug 1492475 - Part 3: The search service init() method should simply return a Promise. r=florian
c1e172dfac
Bug 1492475 - Part 4: Remove the synchronous initialization flow. r=florian
cd41189eac
Bug 1492475 - Part 5: Since async initialization of the search service now is implicit behavior, remove the distinctive verbiage used internally. r=florian
2ae7189dfa
Bug 1492475 - Part 6: Update the cache build task to work with an actual Promise and re-initialize only once at the same time - all to fix race conditions here. r=florian
c8ee92973f
Bug 1492475 - Part 7: Make the region fetch not block the init flow, to ensure it's as fast as possible. r=florian
c44e674e16
Bug 1492475 - Part 8: Introduce an init flag, which can only be used privately, that allows to explicitly skip waiting for the region check process to complete. r=florian
6c79eaf1d3
Bug 1492475 - Part 9: Update unit tests to stop using 'currentEngine', in favor of 'defaultEngine'. r=Standard8
21b3aa17ee
Bug 1492475 - Part 10: Update unit tests to be fully aware of the new, async signatures of the search service API and remove sync init flow tests. r=mkaply,florian
ce5ba69019
Bug 1492475 - Part 11: Repair incorrect usage of the `identifier` property of nsISearchEngine instances. r=florian
fd177a7994
Bug 1518543 - Fix up the Android (Fennec) nsISearchService shim to work with the new asynchronous API. r=florian
3653d8ee22
Bug 1523708 - Change the search service interaction in the show-heartbeat action to use the new async API. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D18355
--HG--
rename : netwerk/base/nsIBrowserSearchService.idl => toolkit/components/search/nsISearchService.idl
extra : moz-landing-system : lando
This starts porting other tests to work with QuantumBar and starts expanding UrlbarTestUtils.jsm with more helper functions.
For the tests, I'm generally using replacing with UrlbarTestUtils except for promiseAutocompleteResultPopup/promiseSearchComplete. These functions feel like they need a more in-depth change (bug 1522902), but probably not until we can remove the old bar.
browser_autocomplete_a11y_label.js and browser_autocomplete_autoselect.js are partially ported, but won't run on QuantumBar yet due to missing functionality.
Depends on D18262
Differential Revision: https://phabricator.services.mozilla.com/D18338
--HG--
rename : browser/components/urlbar/tests/legacy/browser_action_searchengine.js => browser/components/urlbar/tests/browser/browser_action_searchengine.js
rename : browser/components/urlbar/tests/legacy/browser_action_searchengine_alias.js => browser/components/urlbar/tests/browser/browser_action_searchengine_alias.js
rename : browser/components/urlbar/tests/legacy/browser_autocomplete_edit_completed.js => browser/components/urlbar/tests/browser/browser_autocomplete_edit_completed.js
rename : browser/components/urlbar/tests/legacy/browser_new_tab_urlbar_reset.js => browser/components/urlbar/tests/browser/browser_new_tab_urlbar_reset.js
rename : browser/components/urlbar/tests/legacy/browser_urlbar_remove_match.js => browser/components/urlbar/tests/browser/browser_urlbar_remove_match.js
extra : moz-landing-system : lando
browser_UrlbarInput_unit.js leaks the empty.xul window every time I run it on a debug build. I narrowed down the leak to the objects/properties that this patch nulls out after closing the window. Simply cleaning up these properties in a register-cleanup function isn't enough to stop the leak. It happens after the test creates either one of its two UrlbarInputs. Cleaning up the properties after each UrlbarInput is created doesn't stop the leak either. Cleaning up the properties *plus* opening a new window for each UrlbarInput does stop the leak though, so that's what this patch does.
However, the leakcheck test still logs `UNEXPECTED-FAIL leakcheck: default 1392 bytes leaked` at the end, which it does currently without this patch. That doesn't cause the test to fail though, unlike the leaks reported in this bug.
Differential Revision: https://phabricator.services.mozilla.com/D18154
--HG--
extra : moz-landing-system : lando