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

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

Issue 2725743002: Remove TabTest from tab_model_unittest.mm. (Closed)
Patch Set: Rebase. 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 | « no previous file | no next file » | 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 d116d4df79a710428213894050db9dd112c060a4..2f4bb27ddbe062e4a8625d91211d7f068d3e8041 100644
--- a/ios/chrome/browser/tabs/tab_model_unittest.mm
+++ b/ios/chrome/browser/tabs/tab_model_unittest.mm
@@ -52,43 +52,6 @@ using web::WebStateImpl;
toDirectory:(NSString*)directory;
@end
-@interface TabTest : Tab
-
-- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
- lastVisitedTimestamp:(double)lastVisitedTimestamp
- tabModel:(TabModel*)tabModel;
-@end
-
-@implementation TabTest
-
-- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState
- lastVisitedTimestamp:(double)lastVisitedTimestamp
- tabModel:(TabModel*)tabModel {
- id webControllerMock =
- [OCMockObject niceMockForClass:[CRWWebController class]];
-
- auto webStateImpl = base::MakeUnique<WebStateImpl>(browserState);
- webStateImpl->SetWebController(webControllerMock);
- webStateImpl->GetNavigationManagerImpl().InitializeSession(NO);
- [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;
-}
-
-@end
-
@interface TabModel (VisibleForTesting)
- (SessionWindowIOS*)windowForSavingSession;
@end
@@ -761,10 +724,11 @@ TEST_F(TabModelTest, MoveTabs) {
TEST_F(TabModelTest, SetParentModel) {
// Create a tab without a parent model and make sure it doesn't crash. Then
// set its parent TabModel and make sure that works as well.
- base::scoped_nsobject<TabTest> tab([[TabTest alloc]
+ base::scoped_nsobject<Tab> tab([[Tab alloc]
initWithBrowserState:chrome_browser_state_.get()
- lastVisitedTimestamp:100
- tabModel:nil]);
+ opener:nil
+ openedByDOM:NO
+ model:nil]);
EXPECT_TRUE([tab parentTabModel] == nil);
[tab_model_ insertTab:tab atIndex:0];
[tab setParentTabModel:tab_model_.get()];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698