Commit 47388944 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Disallow back forward navigations during async session restoration.

Slim Navigation Manager asynchronously restores the session. During
session restoration it's not possible to perform back-forward
navigation. This change prevents all delta navigations until the session
is restored.

Bug: 877671
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I801a99182582118862d03796532588f1495de9c6
Reviewed-on: https://chromium-review.googlesource.com/1187677Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586041}
parent c2c1d5df
......@@ -381,6 +381,9 @@ bool WKBasedNavigationManagerImpl::CanGoForward() const {
}
bool WKBasedNavigationManagerImpl::CanGoToOffset(int offset) const {
if (is_restore_session_in_progress_)
return false;
// If the last committed item is the empty window.open item, no back-forward
// navigation is allowed.
if (empty_window_open_item_) {
......
......@@ -284,7 +284,12 @@ TEST_F(WebStateTest, RestoreLargeSession) {
// Verify that session was fully restored.
EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForPageLoadTimeout, ^{
return navigation_manager->GetItemCount() == kItemCount;
bool restored = navigation_manager->GetItemCount() == kItemCount;
if (!restored) {
EXPECT_FALSE(navigation_manager->CanGoBack());
EXPECT_FALSE(navigation_manager->CanGoForward());
}
return restored;
}));
EXPECT_EQ(kItemCount, navigation_manager->GetItemCount());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment