Closed Bug 940777 Opened 11 years ago Closed 11 years ago

More restore cleanups

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 28

People

(Reporter: billm, Assigned: billm)

References

Details

(Whiteboard: [qa-])

Attachments

(3 files)

This is a follow-up to bug 930269. It has some of the meatier changes that I was holding off on posting until getting it all green.
This patch ensures that tabData.index is a reasonable value in restoreTabs. That way we can rely on it being correct throughout the rest of the restoration process.
Attachment #8334970 - Flags: review?(ttaubert)
We have a special path to load about:blank if there are no history entries to restore. For some reason this load happens much earlier in the restore process than normal loads do. We also fire the SSTabRestored listener much earlier in this case because didStartLoad ends up as false.

I've moved it so that the about:blank load happens at the normal time. This breaks a test that assumed that the load would still be in progress when SSTabRestored fires, so I just fixed the test.
Attachment #8334976 - Flags: review?(ttaubert)
I'm trying to transition the tests so that they listen for SSTabRestored rather than load events. (Eventually the load event will fire in the child and it will send a message to the parent, which will then fire SSTabRestored.) Right now, we fire SSTabRestored before browser.__SS_data and some other fields have been cleaned up. That can break some tests which perform other session store API calls from within the SSTabRestored handler.

This patch makes sure that session restoration is completely done before triggering SSTabRestored. Note that the deletion of browser.__SS_data in restoreDocument is safe because restoreDocument is only called from the "load" event, and that handler calls onTabLoad right after, which already deletes that field.
Attachment #8334982 - Flags: review?(ttaubert)
Attachment #8334970 - Flags: review?(ttaubert) → review+
Attachment #8334976 - Flags: review?(ttaubert) → review+
Attachment #8334982 - Flags: review?(ttaubert) → review+
Thanks! Always great to clean up some code :)
OS: Linux → All
Hardware: x86_64 → All
Version: unspecified → Trunk
Comment on attachment 8334976 [details] [diff] [review]
simplify-about-blank

Review of attachment 8334976 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/sessionstore/test/browser_522545.js
@@ +210,5 @@
> +           "sessionstore got correct userTypedValue");
> +        is(newState.windows[0].tabs[0].userTypedClear, 0,
> +           "sessionstore got correct userTypedClear");
> +        runNextTest();
> +      }

});
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: