Closed Bug 1624733 Opened 4 years ago Closed 4 years ago

Remove addParam from nsISearchEngine

Categories

(Firefox :: Search, task, P3)

task
Points:
3

Tracking

()

RESOLVED FIXED
Firefox 79
Iteration:
79.1 - June 1 - June 14
Tracking Status
firefox79 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(1 file)

nsISearchEngine.addParam is no-longer necessary in production code, so we should look at removing it from the idl.

We still use it in tests, but I think we should be able to provide a helper function in SearchTestUtils.jsm which creates the engine in one hit using addEngineWithDetails.

This would also help to simplify those tests a bit.

Setting this as a mentored bug, as I think it is suitable, especially for someone who has done patches for Mozilla already.

Clarifying link for where this appears to be used in tests: https://searchfox.org/mozilla-central/search?q=engine.*addParam&case=false&regexp=true&path=*.js

As mentioned above, we should create a new method in SearchTestUtils, probably based on the existing promiseNewSearchEngine, but rather than taking the details, takes the same information as for addEngineWithDetails. We should be able to pass the param data via the details object, something like { postData: "q={searchTerms}" } (depending on the exact options addParams was originally called with).

We should also move the documentation from the nsISearchService file to the function in SearchEngine.jsm, and rename SearchEngine.addParams to SearchEngine._addParams.

If there's basic questions on how to do patches and things, then #introduction on Matrix is a good place to start, if there's questions about the details of the changes, I can be found as Standard8 in the #search channel (or just ask here).

Mentor: standard8
Whiteboard: [lang=js]
Assignee: nobody → standard8
Mentor: standard8
Iteration: --- → 79.1 - June 1 - June 14
Points: --- → 3

In working on this, I've just realised we don't need a separate function on SearchTestUtils - addEngineWithDetails already can take the necessary post/get parameters separately, so we just need to combine the previous addParam calls into it.

Whiteboard: [lang=js]
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/731578a5ef95
Remove addParam from nsISearchEngine, as it is only used in tests. r=daleharvey
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: