Closed Bug 653681 Opened 13 years ago Closed 13 years ago

TabMatcher._getTabsForOtherWindows() must not use nsIWindowMediator.getMostRecentWindow()

Categories

(Firefox Graveyard :: Panorama, defect)

All
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 6

People

(Reporter: ttaubert, Assigned: ttaubert)

References

Details

Attachments

(1 file, 3 obsolete files)

browser_tabview_multwindow_search.js is constantly failing for me when running tabview tests locally. TabMatcher._getTabsForOtherWindows() uses nsIWindowMediator.getMostRecentWindow() to determine the currently focused (the searching) window. We should just use gWindow here.
See also bug 618470.
Assignee: nobody → tim.taubert
See Also: → 618470
Attached patch patch v1 (obsolete) — Splinter Review
Asking Ehsan for review, to distribute Panorama reviews a bit :)

Note: I'll attach a second patch soon that doesn't contain white space changes because I made some coding style corrections, too.
Attachment #529062 - Flags: review?(ehsan)
Same patch as above, without white space changes.
Comment on attachment 529062 [details] [diff] [review]
patch v1

Review of attachment 529062 [details] [diff] [review]:

::: browser/base/content/tabview/search.js
@@ +224,5 @@
   // least once, while <xul:tab>s will be return for windows in which
   // Panorama has never been activated.
   _getTabsForOtherWindows: function TabMatcher__getTabsForOtherWindows(){
+    var enumerator = Cc["@mozilla.org/appshell/window-mediator;1"]
+                     .getService(Ci.nsIWindowMediator)

You should use Services.wm here.
Attached patch patch v2 (obsolete) — Splinter Review
(In reply to comment #4)
> You should use Services.wm here.

Looks much better, thanks :)
Attachment #529062 - Attachment is obsolete: true
Attachment #529062 - Flags: review?(ehsan)
Attachment #529069 - Flags: review?(ehsan)
Comment on attachment 529069 [details] [diff] [review]
patch v2

Review of attachment 529069 [details] [diff] [review]:

::: browser/base/content/tabview/search.js
@@ +219,4 @@
   // ---------
   // Function: _getTabsForOtherWindows
   // Returns an array of <TabItem>s and <xul:tabs>s representing that
   // tabs from all windows but the currently focused window. <TabItem>s

Please replace "currently focused window" with "current window".

@@ +230,4 @@
     while (enumerator.hasMoreElements()) {
       var win = enumerator.getNext();
       // This function gets tabs from other windows: not the one you currently
       // have focused.

ditto
Attachment #529069 - Flags: review?(ehsan) → review+
(In reply to comment #6)
> Please replace "currently focused window" with "current window".

Fixed. Thanks for your review!
Attachment #529063 - Attachment is obsolete: true
Attachment #529069 - Attachment is obsolete: true
Keywords: checkin-needed
Keywords: checkin-needed
Whiteboard: [fixed in cedar]
http://hg.mozilla.org/mozilla-central/rev/9a959f4d17e6
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Whiteboard: [fixed in cedar]
Target Milestone: --- → Firefox 6
Backed out for possibly causing a frequent mochitest-other tabview test failure on Windows debug:
http://hg.mozilla.org/mozilla-central/rev/359643f58412
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Setting to checkin-needed again as this was not causing the m-oth orange.
Keywords: checkin-needed
Re-landed: http://hg.mozilla.org/mozilla-central/rev/af5c044d29ac
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: