De-duplicate SearchService._buildSortedEngineList and SearchService.getDefaultEngines and fix getDefaultEngines sort order
Categories
(Firefox :: Search, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
Attachments
(5 files)
These two functions currently have a lot of code that is very similar:
https://searchfox.org/mozilla-central/rev/088e2cf29c59d733d57af43903eb0267dbf72e2a/toolkit/components/search/SearchService.jsm#2034-2097
https://searchfox.org/mozilla-central/rev/088e2cf29c59d733d57af43903eb0267dbf72e2a/toolkit/components/search/SearchService.jsm#2188-2246
Additionally getDefaultEngines
appears to return the wrong orders when distribution settings are present. It attempts to set the order, then the later writes from processing _searchOrder
can overwrite the distribution settings.
This is shown in the new test I'm adding in bug 1577733 (test_getDefaultEngines.js
).
It would also likely not correctly set the default engines to be first and second, as happens with _buildSortedEngineList
.
We should attempt to unify these two functions, something along the lines of:
- Create another function to get the engines sorted as per the configuration.
- Prefer the
_buildSortedEngineList
structure as that seems most correct.
- Prefer the
- Add more tests for
_buildSortedEngineList
(via the appropriate APIs) to cover:- Distribution engines + Default engines.
Assignee | ||
Comment 1•5 years ago
|
||
I split out the localeCompare changes to bug 1590896, as they're simple on their own, and can be done slightly sooner to enable other work to happen.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D64665
Assignee | ||
Comment 4•5 years ago
|
||
Depends on D64666
Assignee | ||
Comment 5•5 years ago
|
||
Default engines should be after distribution engines. Although all the distributions list the default engine as the first engine, if we ever specify a separate private engine, this may get inserted into the second position, which distributions wouldn't normally expect, hence breaking their orders.
Depends on D64667
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D64668
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/17cf596fb222
https://hg.mozilla.org/mozilla-central/rev/2cd5f484791a
https://hg.mozilla.org/mozilla-central/rev/cf570b3aaf78
https://hg.mozilla.org/mozilla-central/rev/d9146c992830
https://hg.mozilla.org/mozilla-central/rev/ba5cade70de8
Description
•