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

Side by Side Diff: ios/chrome/browser/ui/tabs/tab_strip_controller_unittest.mm

Issue 2775623002: [ios] WebStateList owns all WebState it manages. (Closed)
Patch Set: Fix gn check Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Foundation/Foundation.h> 5 #import <Foundation/Foundation.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" 9 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h"
10 #import "ios/chrome/browser/sessions/test_session_service.h" 10 #import "ios/chrome/browser/sessions/test_session_service.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 [invocation setReturnValue:&browser_state]; 114 [invocation setReturnValue:&browser_state];
115 }] browserState]; 115 }] browserState];
116 [[tabModel stub] addObserver:[OCMArg any]]; 116 [[tabModel stub] addObserver:[OCMArg any]];
117 [[tabModel stub] removeObserver:[OCMArg any]]; 117 [[tabModel stub] removeObserver:[OCMArg any]];
118 118
119 // Stub methods for Tabs. 119 // Stub methods for Tabs.
120 [[[tab1 stub] andReturn:@"Tab Title 1"] title]; 120 [[[tab1 stub] andReturn:@"Tab Title 1"] title];
121 [[[tab2 stub] andReturn:@"Tab Title 2"] title]; 121 [[[tab2 stub] andReturn:@"Tab Title 2"] title];
122 [[[tab1 stub] andReturn:nil] favicon]; 122 [[[tab1 stub] andReturn:nil] favicon];
123 [[[tab2 stub] andReturn:nil] favicon]; 123 [[[tab2 stub] andReturn:nil] favicon];
124 [[tab1 stub] close];
125 [[tab2 stub] close];
126 124
127 tabModel_ = tabModel; 125 tabModel_ = tabModel;
128 tab1_ = tab1; 126 tab1_ = tab1;
129 tab2_ = tab2; 127 tab2_ = tab2;
130 controller_ = 128 controller_ =
131 [[TabStripController alloc] initWithTabModel:(TabModel*)tabModel_ 129 [[TabStripController alloc] initWithTabModel:(TabModel*)tabModel_
132 style:TabStrip::kStyleDark]; 130 style:TabStrip::kStyleDark];
133 131
134 // Force the view to load. 132 // Force the view to load.
135 UIWindow* window = [[UIWindow alloc] initWithFrame:CGRectZero]; 133 UIWindow* window = [[UIWindow alloc] initWithFrame:CGRectZero];
(...skipping 25 matching lines...) Expand all
161 ASSERT_OCMOCK_VERIFY(tab1_); 159 ASSERT_OCMOCK_VERIFY(tab1_);
162 ASSERT_OCMOCK_VERIFY(tab2_); 160 ASSERT_OCMOCK_VERIFY(tab2_);
163 161
164 // There should be two TabViews and one new tab button nested within the 162 // There should be two TabViews and one new tab button nested within the
165 // parent view (which contains exactly one scroll view). 163 // parent view (which contains exactly one scroll view).
166 EXPECT_EQ(3U, 164 EXPECT_EQ(3U,
167 [[[[[controller_ view] subviews] objectAtIndex:0] subviews] count]); 165 [[[[[controller_ view] subviews] objectAtIndex:0] subviews] count]);
168 } 166 }
169 167
170 } // namespace 168 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698