Closed Bug 1821106 Opened 2 years ago Closed 2 years ago

SearchEngine.getResultDomain's responseType parameter is never used and the function needs renaming

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: standard8, Assigned: tiwari.abhishektiwari23, Mentored)

Details

(Whiteboard: [lang=js])

Attachments

(1 file, 1 obsolete file)

SearchEngine.getResultDomain takes a responseType parameter, however, that is never used except for in a test specific for testing getResultDomain.

I don't see us needing it, so I think we should drop it and replace it with a simple getter.

I think we should also rename it to searchUrlDomain.

I'm happy to mentor this, but please note this is not a good first bug, but might be a better second or later bug. You'll also need a full build, otherwise you won't be able to test it properly.

The steps here would be approximately:

  • In nsISearchService.idl, replace the getResultDomain line with readonly attribute AString searchUrlDomain. Update the documentation next to it.
  • In SearchEngine.sys.mjs, change the function signature to get searchUrlDomain(), and simplify the use of the fallback to pass lazy.SearchUtils.URL_TYPE.SEARCH directly to _getURLOfType
  • Update all the existing instances to change from getResultDomain() to searchUrlDomain (note: drop the brackets, as it is now a getter.
  • toolkit/components/search/tests/xpcshell/test_resultDomain.js will need simplifying, and could have the name updated.
  • Check the main search tests pass, fix failures if not.
    • ./mach xpcshell-test toolkit/components/search/
  • Also check ESLint passes (this may take a few minutes to run):
    • ./mach eslint toolkit/components/search/ browser/components/urlbar/

I am giving it a try

Assignee: nobody → tiwari.abhishektiwari23
Status: NEW → ASSIGNED

Sir, Please have a look at the changes that I made, I am successful in making a commit, but it is still failing the test, please guide me. Thanks

Attachment #9322450 - Attachment description: Bug 1821106 - SearchEngine.getResultDomain's responseType parameter is never used and the function needs renaming , this is a initial commit failing in test r=standard8 → Bug 1821106 - SearchEngine.getResultDomain's responseType parameter is never used and the function needs renaming r=standard8
Attachment #9322451 - Attachment is obsolete: true

Hey! I can see there is no activity on this bug for two weeks. I am interested in solving this bug. Can I take it now? Otherwise, if there are any open bugs that need attention, I would be happy to take a look and see if I can help.

I apologise for the delay. The delay happened because of my exam ( mentioned in another bug ). Around four bugs are pending, and I have almost completed this bug and will try to finish the rest task before the contribution deadline.

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4fe91edc1ec6 SearchEngine.getResultDomain's responseType parameter is never used and the function needs renaming r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: