-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1930984 - Implement default search engine selection on the search engine selector. #6495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thank you! Just a couple of idiomatic Rust suggestions, plus switching over to once_cell
.
283bc6a
to
76b5109
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terrific, thank you!
components/search/src/filter.rs
Outdated
assert_eq!( | ||
default_engine_id.unwrap(), | ||
"engine2", | ||
"Should have returned the global default engine when specific environments match, but do not override the global" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand we're testing the default_engine_id is "engine2" but how does this test make sure global default engine2
is not overridden?
Same comment for the test below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'm still not understanding this assertion statement because I don't understand why or how the global engine would ever become overridden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're trying to test that if the specific environment is overriding the private default, then it is not overriding the global default as well.
I've updated the wording for that.
Thank you for writing this. Interesting to see how the filtering is done in Rust for default engines. I was reviewing test_engine_selector_defaults.js#311-321 and wanted to ask if you think we should add a test for matching distro? So we can have the same tests are that file? |
From a unit testing perspective, I don't think that's necessary. We're using the exact same I do notice, however, that I don't have an integration test involving |
76b5109
to
0e18081
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Changes look good to me 👍🏼
There's one assertion statement I don't quite understand - I left it as unresolved. It might be I'm misinterpreting it, if you could help me clarify what you mean there?
0e18081
to
eb79785
Compare
… engine selector.
eb79785
to
78e5e1c
Compare
This adds handling of the default search engines from the search configuration.
This changes the object returned by
filter_engine_configuration
to use anOption
forapp_default_engine_id
as that allows us to highlight there may have been an issue with the configuration - in theory, this should never happen, but just in case, I'd rather the application had potential to be aware of it.No API/changelog necessary as this isn't currently used.
Pull Request checklist
[ci full]
to the PR title.Branch builds: add
[firefox-android: branch-name]
to the PR title.