Closed Bug 477657 Opened 11 years ago Closed 11 years ago

saner default handling for _closedTabs and sizemode


(Firefox :: Session Restore, defect)

Not set



Firefox 3.6a1


(Reporter: zeniko, Assigned: zeniko)




(1 file, 2 obsolete files)

If a session state containing window data without _closedTabs is passed to setBrowserState or setWindowState (or found in sessionstore.js), that window's _closedTabs list should be cleared.

Omitting a window's sizemode property should preserve the current state (and not restore to a non-maximized, non-minimized state).
Attached patch patch (without tests) (obsolete) — Splinter Review
We should also clear window values (set with setWindowValue) when overwriting a window's state with setWindowState. Tests follow as soon as I (or anybody else) find time for writing them.
Simon, part of this patch is no longer needed with bug 476463 landed...
Attached patch patch and tests (obsolete) — Splinter Review
This includes a test for the bits already checked in in bug 476463.
Assignee: nobody → zeniko
Attachment #361328 - Attachment is obsolete: true
Attachment #363420 - Flags: review?(dietrich)
Comment on attachment 363420 [details] [diff] [review]
patch and tests

looks fine, r=me
Attachment #363420 - Flags: review?(dietrich) → review+
Keywords: checkin-needed
Closed: 11 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.2a1
Attachment #363420 - Flags: approval1.9.1?
This test is failing on trunk right now:

TEST-UNEXPECTED-FAIL | chrome://mochikit/content/browser/browser/components/sessionstore/test/browser/browser_477657.js | the window was maximized - Got 3, expected 1

There's a chance that nobody noticed because of the recurring focus-related oranges until now.

I suggest we back this out.
backed out
Resolution: FIXED → ---
Attached patch fixed testSplinter Review
I was so focused on using executeSoon instead of setTimeout that I managed to miss the fact that we need a setTimeout here after all: to mirror the setTimeout in nsSessionStore.js's sss_restoreWindowFeatures.
Attachment #363420 - Attachment is obsolete: true
Attachment #363420 - Flags: approval1.9.1?
Keywords: checkin-needed
(In reply to comment #8)
> mirror the setTimeout in nsSessionStore.js's sss_restoreWindowFeatures.

Won't that be fragile?
(In reply to comment #9)
> Won't that be fragile?

As long as these timeouts are queued on the same thread, they'll always happen in the same order.
Closed: 11 years ago11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
This failed today.

on mac:
the window was explicitly unmaximized - Didn't expect 1, but got it

and windows:
the window was maximized - Got 3, expected 1
Depends on: 482975
Flags: in-testsuite+ → in-testsuite?
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.