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

Unified Diff: ios/web/web_state/ui/crw_web_controller_unittest.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
Index: ios/web/web_state/ui/crw_web_controller_unittest.mm
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index ffa44dad263412b4164392ff9a191c8266a4f84d..e6361988c5e25a6f0abf2fe874513224e62722a7 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -850,17 +850,17 @@ class CRWWebControllerWindowOpenTest : public web::WebTestWithWebController {
ASSERT_TRUE([delegate_ blockPopups]);
[webController_ setDelegate:delegate_];
- // Configure child web controller.
- child_.reset(CreateWebController());
- [child_ setWebUsageEnabled:YES];
- [delegate_ setChildWebController:child_];
+ // Configure child web state.
+ child_web_state_.reset(new web::WebStateImpl(GetBrowserState()));
+ [child_web_state_->GetWebController() setWebUsageEnabled:YES];
+ [delegate_ setChildWebController:child_web_state_->GetWebController()];
// Configure child web controller's session controller mock.
id sessionController =
[OCMockObject niceMockForClass:[CRWSessionController class]];
BOOL yes = YES;
[[[sessionController stub] andReturnValue:OCMOCK_VALUE(yes)] isOpenedByDOM];
- [child_ webStateImpl]->GetNavigationManagerImpl().SetSessionController(
+ child_web_state_->GetNavigationManagerImpl().SetSessionController(
sessionController);
LoadHtml(@"<html><body></body></html>");
@@ -868,7 +868,6 @@ class CRWWebControllerWindowOpenTest : public web::WebTestWithWebController {
void TearDown() override {
EXPECT_OCMOCK_VERIFY(delegate_);
[webController_ setDelegate:nil];
- [child_ close];
web::WebTestWithWebController::TearDown();
}
@@ -884,8 +883,8 @@ class CRWWebControllerWindowOpenTest : public web::WebTestWithWebController {
}
// A CRWWebDelegate mock used for testing.
base::scoped_nsobject<id> delegate_;
- // A child CRWWebController used for testing.
- base::scoped_nsobject<CRWWebController> child_;
+ // A child WebState used for testing.
+ std::unique_ptr<web::WebStateImpl> child_web_state_;
};
// Tests that absence of web delegate is handled gracefully.
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller+protected.h ('k') | ios/web/web_state/ui/crw_wk_web_view_web_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698