Closed Bug 1617856 Opened 5 years ago Closed 5 years ago

Modify createHost helper in devtools/client/shared/test/head.js to return an object instead of an array

Categories

(DevTools :: Console, task, P3)

task

Tracking

(firefox75 fixed)

RESOLVED FIXED
Firefox 75
Tracking Status
firefox75 --- fixed

People

(Reporter: nchevobbe, Assigned: manas.khurana20, Mentored)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

The createHost helper (devtools/client/shared/test/head.js#112-125 ) which is used in tests return an array with 3 element:

  • host
  • iframe.contentWindow
  • iframe.contentDocument

most of the time, the test does not need all those, which can result in less than ideal destructuring (e.g. const [, , doc] = await createHost("bottom", TEST_URI);)

We should modify the function so it returns an object like with the host, contentWindow and contentDocument properties.

With that done, the tests calling the helper (https://searchfox.org/mozilla-central/search?q=createHost(&case=true&regexp=false&path=devtools%2Fclient%2Fshared%2F) should be updated.

May I try to solve this?

Hello manas, thanks for offering help!
The bug is now yours :)

If it's your first bug, you might want to read this https://docs.firefox-dev.tools/getting-started/ to setup the work environment.
Make sure to select "Artifact builds" when asked as it speeds up the workflow quite a bit :)

After you made the changes, you can run the tests with ./mach mochitest devtools/client/shared/test/ --headless to ensure everything is okay.

Also, you can come and chat on our Slack https://devtools-html-slack.herokuapp.com/

Assignee: nobody → manas.khurana20
Status: NEW → ASSIGNED

Hey, does this look okay now?

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8426c08b6e7 Convert array destructuring to object destructuring. r=nchevobbe

yes this looks good, I pushed the patch

Flags: needinfo?(nchevobbe)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: