Bug 1531971 - Make the test wait for the second page to actually paint before attempting to restore the first page from bfcache. r=smaug
The first page's content viewer is only saved in the bfcache when the second page is painted. This can happen after the load event is fired, and in that scenario, attempting to go back to the first page will reload it rather than restore it from the bfcache. So for the test to work properly it needs to wait until the second page is actually painted before it attempts go back. Differential Revision: https://phabricator.services.mozilla.com/D79347
This commit is contained in:
@@ -1685,6 +1685,8 @@ nsDocumentViewer::Destroy() {
|
||||
// DisallowBFCaching() after CanSavePresentation() already ran. Ensure that
|
||||
// the SHEntry has no viewer and its state is synced up. We want to do this
|
||||
// via a stack reference, in case those calls mess with our members.
|
||||
MOZ_LOG(gPageCacheLog, LogLevel::Debug,
|
||||
("BFCache not allowed, dropping SHEntry"));
|
||||
nsCOMPtr<nsISHEntry> shEntry = std::move(mSHEntry);
|
||||
shEntry->SetContentViewer(nullptr);
|
||||
shEntry->SyncPresentationState();
|
||||
@@ -1742,6 +1744,8 @@ nsDocumentViewer::Destroy() {
|
||||
nsCOMPtr<nsISHEntry> shEntry =
|
||||
std::move(mSHEntry); // we'll need this below
|
||||
|
||||
MOZ_LOG(gPageCacheLog, LogLevel::Debug,
|
||||
("Storing content viewer into cache entry"));
|
||||
shEntry->SetContentViewer(this);
|
||||
|
||||
// Always sync the presentation state. That way even if someone screws up
|
||||
|
||||
Reference in New Issue
Block a user