Use SearchUtils.BROWSER_SEARCH_PREF in search tests
Categories
(Firefox :: Search, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: standard8, Assigned: prem.kumar.krishnan, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=js])
Attachments
(1 file)
In bug 1550599 I added SearchUtils.jsm
with BROWSER_SEARCH_PREF
.
BROWSER_SEARCH_PREF
is currently used in various places within our search tests, and we should replace the separate definitions with direct references to SearchUtils.BROWSER_SEARCH_PREF
. Here's the current list of instances:
To help Mozilla out with this bug, here's the steps:
- Comment here on the bug that you want to volunteer to help. I (or someone else) will assign it to you.
- Download and build the Firefox source code: https://developer.mozilla.org/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build (an artifact build is sufficient).
- If you have any problems, please ask on IRC (https://wiki.mozilla.org/Irc) in the #introduction channel. They're there to help you get started.
You can also read the Developer Guide, which has answers to most development questions: https://developer.mozilla.org/docs/Mozilla/Developer_guide/Introduction
- If you have any problems, please ask on IRC (https://wiki.mozilla.org/Irc) in the #introduction channel. They're there to help you get started.
- Start working on this bug.
- Examine the existing source code lines
- Remove the existing
const BROWSER_SEARCH_PREF = "browser.search.";
lines. - In
toolkit/components/search/tests/xpcshell/head_search.js
extendXPCOMUtils.defineLazyModuleGetters
to referenceSearchUtils.jsm.
- In
browser/components/search/test/browser/head.js
please create a newXPCOMUtils.defineLazyModuleGetters
call and move the existingCustomizableUITestUtils.jsm
import into it, and add the import ofSearchUtils.jsm
- Replace the remaining references to
BROWSER_SEARCH_PREF
withSearchUtils.BROWSER_SEARCH_PREF
- Check you changes for adherence to our guidelines by using:
./mach lint toolkit/components/search browser/components/search
- Build your change with mach build and test your change with:
./mach xpcshell-test toolkit/components/search
./mach mochitest browser/components/search
- Submit the patch for review. Mark me as a reviewer (r?standard8) so I'll get an email to come look at your code.
- Here's the guide.
- I suggest using moz_phab to push the patch.
- After a series of reviews and changes to your patch, I'll mark it for checkin or push it to autoland. Your code will soon be shipping to Firefox users worldwide!
- ...now you get to think about what kind of bug you'd like to work on next. Let me know what you're interested in and I can help you find your next contribution.
Hi :standard8,
I'm new here. I'd like to help with this bug. Please assign it to me.
Comment 2•5 years ago
|
||
Hello :standard8,
I would like to work on this too.
Reporter | ||
Comment 3•5 years ago
|
||
premk, as you commented first I'll assign it to you. Note, please use moz-phab for submitting patches, it makes it easier for us.
Karan, I have some other options you may be interested in - I'll contact you direct.
Thanks :standard8.
What is the resource reference path for importing SearchUtils.jsm using XPCOMUtils.defineLazyModuleGetters?
I tried poking around but couldn't find it.
Reporter | ||
Comment 5•5 years ago
|
||
(In reply to premk from comment #4)
What is the resource reference path for importing SearchUtils.jsm using XPCOMUtils.defineLazyModuleGetters?
I tried poking around but couldn't find it.
The easiest way of finding references like this is to use searchfox, e.g. https://searchfox.org/mozilla-central/search?q=SearchUtils.jsm&case=false®exp=false&path=
In this case you can copy https://searchfox.org/mozilla-central/rev/9eb2f739c165b4e294929f7b99fbb4d90f8a396b/toolkit/components/search/SearchEngine.jsm#13
Thanks, got it. Necessary changes made. All the tests passed.
I've submitted the patch to phabricator for your review.
Reporter | ||
Comment 8•5 years ago
|
||
Hi, thank you for the patch. No need to needinfo here, Phabricator informs me automatically (as long as you've set me as reviewer).
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d8cc60b60e82 Use SearchUtils.BROWSER_SEARCH_PREF in search tests r=Standard8
Comment 10•5 years ago
|
||
bugherder |
Description
•