Closed
Bug 926579
Opened 12 years ago
Closed 9 years ago
Find ways to remove duplication between the getWindowsFragment and getTabsFragment function of RecentlyClosedTabsAndWindowsMenuUtils
Categories
(Firefox :: Session Restore, defect)
Firefox
Session Restore
Tracking
()
RESOLVED
FIXED
Firefox 52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: jaws, Assigned: davidmalaschonok, Mentored)
References
Details
(Whiteboard: [see comment #8 for tips to get started on this bug][good first bug][lang=js][outreachy-12])
Attachments
(1 file, 3 obsolete files)
Comment hidden (typo) |
Reporter | ||
Updated•12 years ago
|
Updated•12 years ago
|
Whiteboard: [good first bug][mentor=jaws][lang=js] → [good first bug][mentor=jaws][lang=js] [Australis:M-]
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Reporter | ||
Comment 4•12 years ago
|
||
After you make changes to the file, you can run `./mach build browser/components/sessionstore` and then `./mach run` to run the browser. To run the sessionstore tests you can run `./mach mochitest-browser browser/components/sessionstore/test/`.
You should join #introduction on irc.mozilla.org to get more detailed help.
Comment hidden (obsolete) |
Updated•11 years ago
|
Mentor: jaws
Whiteboard: [good first bug][mentor=jaws][lang=js] [Australis:M-] → [good first bug][lang=js] [Australis:M-]
Comment hidden (obsolete) |
Updated•9 years ago
|
Flags: needinfo?(aveek1)
Reporter | ||
Updated•9 years ago
|
Whiteboard: [good first bug][lang=js] [Australis:M-] → [good first bug][lang=js][outreachy-12]
Comment hidden (obsolete) |
Reporter | ||
Comment 8•9 years ago
|
||
The file is located at /browser/components/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm
Inside of the file you will find two functions that look very similar, getTabsFragment and getWindowsFragment.
The goal of this bug is to reduce duplication between those two functions by pulling out similar code to some shared functions.
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Reporter | ||
Comment 11•9 years ago
|
||
There is no UX branch anymore. You should clone mozilla-central at https://hg.mozilla.org/mozilla-central.
Then you can run `./mach build`. Follow the instructions at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build to get started.
Reporter | ||
Updated•9 years ago
|
Whiteboard: [good first bug][lang=js][outreachy-12] → [see comment #8 for tips to get started on this bug][good first bug][lang=js][outreachy-12]
Comment 12•9 years ago
|
||
I have created a new function by pulling out the similar parts in the two functions. I built it and ran the code. But I want to test the functionality of the parts I have changed. How can I do that?
Reporter | ||
Updated•9 years ago
|
Flags: needinfo?(jaws)
Reporter | ||
Comment 13•9 years ago
|
||
(In reply to Harithaki from comment #12)
> I have created a new function by pulling out the similar parts in the two
> functions. I built it and ran the code. But I want to test the functionality
> of the parts I have changed. How can I do that?
1. Open up some windows and go to some web pages in them. Now close those windows. Open up some tabs and go to some webpages in them. Now close those tabs.
2. Open the Firefox menu and click on the History button
3. Look at the Recently Closed Windows and Recently Closed Tabs in the menu.
The items in the menu should match the windows and tabs that you just closed.
Flags: needinfo?(jaws)
Comment hidden (off-topic) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (mozreview-request) |
Reporter | ||
Comment 26•9 years ago
|
||
mozreview-review |
Comment on attachment 8803080 [details]
Bug 926579 - Remove duplication in RecentlyClosedTabsAndWindowsMenuUtils through refactoring.
https://reviewboard.mozilla.org/r/87304/#review86572
This looks really great! Please make the following changes and re-push to mozreview and I'll land this for you. Thanks!
There are a few lines that have trailing whitespace that got introduced with this patch. Please remove all trailing whitespace in this file.
::: browser/components/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm:115
(Diff revision 1)
> function setImage(aWindow, aItem, aElement) {
> let iconURL = aItem.image;
> // don't initiate a connection just to fetch a favicon (see bug 467828)
> if (/^https?:/.test(iconURL))
> iconURL = "moz-anno:favicon:" + iconURL;
>
> aElement.setAttribute("image", iconURL);
> }
note, aWindow is unused in this function so it can be removed from the list of arguments.
::: browser/components/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm:141
(Diff revision 1)
> +function createEntry(aTagName, aIsWindowsFragment, aIndex, aClosedTab,
> + aWindow, aMenuLabel, aFragment) {
> + let doc = aWindow.document;
Since we don't need to pass aWindow to setImage anymore, we can change createEntry to take `document` as the argument instead of `window`. Same for createRestoreAllEntry.
Attachment #8803080 -
Flags: review?(jaws) → review+
Reporter | ||
Updated•9 years ago
|
Assignee: nobody → davidmalaschonok
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Reporter | ||
Comment 28•9 years ago
|
||
mozreview-review |
Comment on attachment 8803423 [details]
Bug 926579 #2 - Remove unused parameters in RecentlyClosedTabsAndWindowsMenuUtils.
https://reviewboard.mozilla.org/r/87702/#review86702
Thanks! I'll merge these two patches and push them to the fx-team repo. After this lands in fx-team, it will get merged to mozilla-central in a day or two. The next day this change will appear in Firefox Nightly. Thanks for your help and very well written patches!
Attachment #8803423 -
Flags: review?(jaws) → review+
Comment hidden (mozreview-request) |
Reporter | ||
Comment 30•9 years ago
|
||
mozreview-review |
Comment on attachment 8803485 [details]
Bug 926579 - Remove duplication in RecentlyClosedTabsAndWindowsMenuUtils through refactoring.
https://reviewboard.mozilla.org/r/87742/#review86710
Attachment #8803485 -
Flags: review?(jaws) → review+
Reporter | ||
Updated•9 years ago
|
Attachment #8803423 -
Attachment is obsolete: true
Reporter | ||
Updated•9 years ago
|
Attachment #8803080 -
Attachment is obsolete: true
Reporter | ||
Updated•9 years ago
|
Attachment #8774114 -
Attachment is obsolete: true
Comment 31•9 years ago
|
||
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/da1b726ffaee
Remove duplication in RecentlyClosedTabsAndWindowsMenuUtils through refactoring. r=jaws
Comment 32•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Reporter | ||
Comment 33•9 years ago
|
||
Thanks for the patch David. Would you like to work on bug 552434 next? I think you'd be well suited since you were able to handle this bug pretty quickly.
Flags: needinfo?(davidmalaschonok)
Assignee | ||
Comment 34•9 years ago
|
||
Thank you for pointing me at it. I'll definitely give it a shot.
Flags: needinfo?(davidmalaschonok)
You need to log in
before you can comment on or make changes to this bug.