Commit 1ae59532 authored by Danyao Wang's avatar Danyao Wang Committed by Commit Bot

Revert "[Nav Experiment] Call LoadIfNecessary() in CWVWebView session restore."

This reverts commit b21bf2bb.

Reason for revert: broke the build: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8923328721517960816/+/steps/compile/0/stdout

Original change's description:
> [Nav Experiment] Call LoadIfNecessary() in CWVWebView session restore.
> 
> The web view load scheduled by WKBasedNavigationManager::Restore() is
> deferred when used in CWVWebView's |resetWebStateWithSessionStorage|
> because the |_containerView| is not created until later. This CL calls
> LoadIfNecessary() explicitly after the view is created to trigger the
> session restoration.
> 
> This fixes WebViewRestorableStateTest when WKBasedNavigationManger is
> enabled. A better approach would be to turn this test into a
> programmatic test so both navigation managers implementations are
> tested, but web::features symbols are not exposed in ios/web_view.
> 
> Bug: 862714
> Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;luci.chromium.try:ios-simulator-cronet
> Change-Id: I21e694e3fef6a833f1cce04ff9cebd3784349111
> Reviewed-on: https://chromium-review.googlesource.com/c/1135435
> Commit-Queue: Danyao Wang <danyao@chromium.org>
> Reviewed-by: Eugene But <eugenebut@chromium.org>
> Reviewed-by: Hiroshi Ichikawa <ichikawa@chromium.org>
> Reviewed-by: Justin Cohen <justincohen@chromium.org>
> Auto-Submit: Danyao Wang <danyao@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#626170}

TBR=justincohen@chromium.org,eugenebut@chromium.org,jbudorick@chromium.org,danyao@chromium.org,ichikawa@chromium.org

Change-Id: Ie5346cd1e76b6e7510f589e2cb36602ed7cc0fbd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 862714
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;luci.chromium.try:ios-simulator-cronet
Reviewed-on: https://chromium-review.googlesource.com/c/1436172Reviewed-by: default avatarDanyao Wang <danyao@chromium.org>
Commit-Queue: Danyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626181}
parent 50945f94
......@@ -20,7 +20,6 @@
#import "ios/web/public/navigation_manager.h"
#include "ios/web/public/referrer.h"
#include "ios/web/public/reload_type.h"
#import "ios/web/public/web_client.h"
#import "ios/web/public/web_state/context_menu_params.h"
#import "ios/web/public/web_state/js/crw_js_injection_receiver.h"
#import "ios/web/public/web_state/navigation_context.h"
......@@ -661,12 +660,6 @@ static NSString* gUserAgentProduct = nil;
[self updateVisibleSSLStatus];
self.loading = NO;
self.estimatedProgress = 0.0;
// TODO(crbug.com/873729): The session will not be restored until
// LoadIfNecessary call. Fix the bug and remove extra call.
if (web::GetWebClient()->IsSlimNavigationManagerEnabled() && sessionStorage) {
_webState->GetNavigationManager()->LoadIfNecessary();
}
}
// Adds the web view provided by |_webState| as a subview unless it has already.
......
......@@ -4,7 +4,6 @@
#import <ChromeWebView/ChromeWebView.h>
#import "base/test/ios/wait_util.h"
#import "ios/web_view/test/web_view_inttest_base.h"
#import "ios/web_view/test/web_view_test_util.h"
#include "testing/gtest_mac.h"
......@@ -13,9 +12,6 @@
#error "This file requires ARC support."
#endif
using base::test::ios::WaitUntilConditionOrTimeout;
using base::test::ios::kWaitForPageLoadTimeout;
namespace ios_web_view {
// Tests encodeRestorableStateWithCoder: and decodeRestorableStateWithCoder:
......@@ -40,11 +36,6 @@ TEST_F(WebViewRestorableStateTest, EncodeDecode) {
CWVWebView* restored_web_view = test::CreateWebView();
test::CopyWebViewState(web_view_, restored_web_view);
// Wait for restore to finish.
ASSERT_TRUE(WaitUntilConditionOrTimeout(kWaitForPageLoadTimeout, ^{
return [restored_web_view canGoBack];
}));
// Verify that the state has been restored correctly.
EXPECT_NSEQ(@"about:blank",
[restored_web_view lastCommittedURL].absoluteString);
......
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