Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Unified Diff: ios/web/test/web_test.mm

Issue 1874903003: Reversed WebState <-> CRWWebController ownership. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged with origin/master Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/test/web_test.h ('k') | ios/web/web_state/ui/crw_web_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/test/web_test.mm
diff --git a/ios/web/test/web_test.mm b/ios/web/test/web_test.mm
index d58956833214ab3c5c07b89bdb46829575874643..6627b0e1cdf520b21d5d87fc44c05338e3e78c78 100644
--- a/ios/web/test/web_test.mm
+++ b/ios/web/test/web_test.mm
@@ -68,7 +68,10 @@ static int s_html_load_count;
void WebTestWithWebController::SetUp() {
WebTest::SetUp();
- webController_.reset(this->CreateWebController());
+ web_state_impl_.reset(new WebStateImpl(GetBrowserState()));
+ web_state_impl_->GetNavigationManagerImpl().InitializeSession(nil, nil, NO,
+ 0);
+ webController_.reset(web_state_impl_->GetWebController());
[webController_ setWebUsageEnabled:YES];
// Force generation of child views; necessary for some tests.
@@ -77,7 +80,7 @@ void WebTestWithWebController::SetUp() {
}
void WebTestWithWebController::TearDown() {
- [webController_ close];
+ web_state_impl_.reset();
WebTest::TearDown();
}
@@ -176,13 +179,6 @@ NSString* WebTestWithWebController::RunJavaScript(NSString* script) {
return [[evaluationResult retain] autorelease];
}
-CRWWebController* WebTestWithWebController::CreateWebController() {
- std::unique_ptr<WebStateImpl> web_state_impl(
- new WebStateImpl(GetBrowserState()));
- return [[CRWWKWebViewWebController alloc]
- initWithWebState:std::move(web_state_impl)];
-}
-
void WebTestWithWebController::WillProcessTask(
const base::PendingTask& pending_task) {
// Nothing to do.
« no previous file with comments | « ios/web/test/web_test.h ('k') | ios/web/web_state/ui/crw_web_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698