Closed Bug 586506 Opened 15 years ago Closed 15 years ago

unregisterOpenPage should not come before registerOpenPage when removeTab is called before/during onLocationChange

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 4.0b4

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(1 file, 4 obsolete files)

Attached patch patch v1.0 (obsolete) — Splinter Review
I've found this other glitch in switch-to-tab code that is causing a failure when i push bug 546253, since that bug is checking about:blank from previous tests too. also makes the test wait for proper visit notification (to be sure data is in the db before looking for it). Will need approval to land with bug 546253
Attachment #465011 - Flags: review?(gavin.sharp)
to explain, lastURI is setup when page is registered, so it's a safer check to unregister.
Summary: unregisterOpenPage should not be called before registerOpenPage if removeTab is called immediately → unregisterOpenPage should not come before registerOpenPage when removeTab is called immediately
Flags: in-testsuite?
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Comment on attachment 465011 [details] [diff] [review] patch v1.0 Discussed with dao, the problem with this approach is that we would still fail if someone calls removeTab in a sub onLocationChange listener because lastURI is setup later. But at the same time if we set lastURI before the listeners will be unable to know previous uri. So, the only best solution I can think of is to have a specific .registeredOpenURI property for this scope.
Attachment #465011 - Attachment is obsolete: true
Attachment #465011 - Flags: review?(gavin.sharp)
Summary: unregisterOpenPage should not come before registerOpenPage when removeTab is called immediately → unregisterOpenPage should not come before registerOpenPage when removeTab is called before/during onLocationChange
Attached patch patch v1.1 (obsolete) — Splinter Review
use a new property
Attachment #465673 - Flags: review?(dao)
Comment on attachment 465673 [details] [diff] [review] patch v1.1 s/registeredOpenURI/_registeredOpenURI/ I haven't really reviewed the test, but this can be a plain function thanks to bug 538920: >+ let visitObserver = { >+ observe: function(aSubject, aTopic, aData)
Attachment #465673 - Flags: review?(dao) → review+
Attached patch patch v1.2 (obsolete) — Splinter Review
addressed comment
Attachment #465673 - Attachment is obsolete: true
Comment on attachment 465681 [details] [diff] [review] patch v1.2 >+ Services.obs.addObserver( >+ function (aSubject, aTopic, aData) { >+ if (url != aSubject.QueryInterface(Ci.nsIURI).spec) >+ return; >+ Services.obs.removeObserver(this, aTopic); 'this' needs to be arguments.callee instead
Attachment #465681 - Flags: approval2.0?
wtf, yeah, I hate last minute changes (doing in seconds)
Attached patch patch v1.3 (obsolete) — Splinter Review
Attachment #465681 - Attachment is obsolete: true
Attachment #465686 - Flags: approval2.0?
Attachment #465681 - Flags: approval2.0?
Attachment #465686 - Flags: approval2.0? → approval2.0+
Attached patch patch v1.4Splinter Review
with correct commit message
Attachment #465686 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 4.0b4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: