LoadIfNecessaryTest.DisableAndReenableWebUsage fails with WKBasedNavigationManager |
||||
Issue descriptionThis test fails the expectation on line 1026: ../../ios/web/web_state/ui/crw_web_controller_unittest.mm:1026: Failure Value of: test::WaitForWebViewContainingText(web_state_.get(), "pony") Actual: false Expected: true It looks like the WKWebView is freed when web_state_->SetWebUsageEnabled(false) in line 1020. The history needs to be restored when recreating WKWebView. What is the purpose of SetWebUsageEnabled? Perhaps another workaround should be not freeing WKWebView.
,
Oct 27 2017
Reading through commit history, it seems that SetWebUsageEnabled() was introduced to release the web view when it is not needed (i.e. showing a native controller). My understanding is that this is to manage memory usage. With the switch to WKWebView and WebKit, the rendering engine is in a separate web process from the app process. When I talked with eugenebut@ and kkhorimoto@ offline, they believe the cost of keeping WKWebView alive now should not be as significant as before. With new navigation manager, we will always need a web view anyways even for native controller URL. I propose we stop freeing the webview. Longer term, we may be able to deprecate the SetWebUsageEnabled() API.
,
Nov 21 2017
,
Nov 24 2017
,
Nov 28 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by danyao@chromium.org
, Oct 27 2017Status: Started (was: Available)