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

Unified Diff: ios/chrome/browser/tabs/tab_model_unittest.mm

Issue 2685653002: Remove TabModel -replaceWebState: method. (Closed)
Patch Set: Fix indentation in the initializer. Created 3 years, 10 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/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/tabs/tab_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model_unittest.mm
diff --git a/ios/chrome/browser/tabs/tab_model_unittest.mm b/ios/chrome/browser/tabs/tab_model_unittest.mm
index c9e60b5d9768c4c13a193d16e2f697a29a10ee18..56507f5d7f1c03fe2b37099ed297a9a2c5c3aa3d 100644
--- a/ios/chrome/browser/tabs/tab_model_unittest.mm
+++ b/ios/chrome/browser/tabs/tab_model_unittest.mm
@@ -13,6 +13,7 @@
#include "ios/chrome/browser/browser_state/test_chrome_browser_state_manager.h"
#include "ios/chrome/browser/chrome_url_constants.h"
#include "ios/chrome/browser/infobars/infobar_manager_impl.h"
+#include "ios/chrome/browser/sessions/ios_chrome_session_tab_helper.h"
#import "ios/chrome/browser/sessions/session_window.h"
#import "ios/chrome/browser/sessions/test_session_service.h"
#import "ios/chrome/browser/tabs/tab.h"
@@ -64,29 +65,26 @@ using web::WebStateImpl;
lastVisitedTimestamp:(double)lastVisitedTimestamp
browserState:(ios::ChromeBrowserState*)browserState
tabModel:(TabModel*)tabModel {
- self = [super initWithWindowName:windowName
- opener:nil
- openedByDOM:NO
- model:tabModel
- browserState:browserState];
- if (self) {
- id webControllerMock =
- [OCMockObject niceMockForClass:[CRWWebController class]];
-
- auto webStateImpl = base::MakeUnique<WebStateImpl>(browserState);
- webStateImpl->SetWebController(webControllerMock);
- webStateImpl->GetNavigationManagerImpl().InitializeSession(
- windowName, @"opener", NO, -1);
- [webStateImpl->GetNavigationManagerImpl().GetSessionController()
- setLastVisitedTimestamp:lastVisitedTimestamp];
-
- WebStateImpl* webStateImplPtr = webStateImpl.get();
- [[[webControllerMock stub] andReturnValue:OCMOCK_VALUE(webStateImplPtr)]
- webStateImpl];
- BOOL yes = YES;
- [[[webControllerMock stub] andReturnValue:OCMOCK_VALUE(yes)] isViewAlive];
-
- [self replaceWebState:std::move(webStateImpl)];
+ id webControllerMock =
+ [OCMockObject niceMockForClass:[CRWWebController class]];
+
+ auto webStateImpl = base::MakeUnique<WebStateImpl>(browserState);
+ webStateImpl->SetWebController(webControllerMock);
+ webStateImpl->GetNavigationManagerImpl().InitializeSession(windowName,
+ @"opener", NO, -1);
+ [webStateImpl->GetNavigationManagerImpl().GetSessionController()
+ setLastVisitedTimestamp:lastVisitedTimestamp];
+
+ WebStateImpl* webStateImplPtr = webStateImpl.get();
+ [[[webControllerMock stub] andReturnValue:OCMOCK_VALUE(webStateImplPtr)]
+ webStateImpl];
+ BOOL yes = YES;
+ [[[webControllerMock stub] andReturnValue:OCMOCK_VALUE(yes)] isViewAlive];
+
+ if ((self = [super initWithWebState:std::move(webStateImpl)
+ model:tabModel
+ attachTabHelpers:NO])) {
+ IOSChromeSessionTabHelper::CreateForWebState(self.webState);
}
return self;
}
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/tabs/tab_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698