| Index: ios/chrome/browser/ui/browser_view_controller_unittest.mm
|
| diff --git a/ios/chrome/browser/ui/browser_view_controller_unittest.mm b/ios/chrome/browser/ui/browser_view_controller_unittest.mm
|
| index 968e2e498b566e3969b78ba968382d694f7c8878..162e3c5e2f05d82db18c8f7f51247080bfc0f203 100644
|
| --- a/ios/chrome/browser/ui/browser_view_controller_unittest.mm
|
| +++ b/ios/chrome/browser/ui/browser_view_controller_unittest.mm
|
| @@ -82,11 +82,15 @@ - (IBAction)chromeExecuteCommand:(id)sender;
|
| @end
|
|
|
| @interface BVCTestTabMock : OCMockComplexTypeHelper {
|
| - GURL url_;
|
| - WebStateImpl* webState_;
|
| + GURL _url;
|
| + GURL _lastCommittedURL;
|
| + GURL _visibleURL;
|
| + WebStateImpl* _webState;
|
| }
|
|
|
| @property(nonatomic, assign) const GURL& url;
|
| +@property(nonatomic, assign) const GURL& lastCommittedURL;
|
| +@property(nonatomic, assign) const GURL& visibleURL;
|
| @property(nonatomic, assign) WebStateImpl* webState;
|
|
|
| - (web::NavigationManager*)navigationManager;
|
| @@ -96,22 +100,34 @@ @interface BVCTestTabMock : OCMockComplexTypeHelper {
|
|
|
| @implementation BVCTestTabMock
|
| - (const GURL&)url {
|
| - return url_;
|
| + return _url;
|
| }
|
| - (void)setUrl:(const GURL&)url {
|
| - url_ = url;
|
| + _url = url;
|
| +}
|
| +- (const GURL&)lastCommittedURL {
|
| + return _lastCommittedURL;
|
| +}
|
| +- (void)setLastCommittedURL:(const GURL&)lastCommittedURL {
|
| + _lastCommittedURL = lastCommittedURL;
|
| +}
|
| +- (const GURL&)visibleURL {
|
| + return _visibleURL;
|
| +}
|
| +- (void)setVisibleURL:(const GURL&)visibleURL {
|
| + _visibleURL = visibleURL;
|
| }
|
| - (WebStateImpl*)webState {
|
| - return webState_;
|
| + return _webState;
|
| }
|
| - (void)setWebState:(WebStateImpl*)webState {
|
| - webState_ = webState;
|
| + _webState = webState;
|
| }
|
| - (web::NavigationManager*)navigationManager {
|
| - return &(webState_->GetNavigationManagerImpl());
|
| + return &(_webState->GetNavigationManagerImpl());
|
| }
|
| - (web::NavigationManagerImpl*)navigationManagerImpl {
|
| - return &(webState_->GetNavigationManagerImpl());
|
| + return &(_webState->GetNavigationManagerImpl());
|
| }
|
| @end
|
|
|
| @@ -422,7 +438,9 @@ void TearDown() override {
|
| TEST_F(BrowserViewControllerTest, TestSharePageCommandHandling) {
|
| GURL expectedUrl("http://www.testurl.net");
|
| NSString* expectedTitle = @"title";
|
| - [static_cast<BVCTestTabMock*>(tab_.get()) setUrl:expectedUrl];
|
| + static_cast<BVCTestTabMock*>(tab_.get()).url = expectedUrl;
|
| + static_cast<BVCTestTabMock*>(tab_.get()).lastCommittedURL = expectedUrl;
|
| + static_cast<BVCTestTabMock*>(tab_.get()).visibleURL = expectedUrl;
|
| OCMockObject* tabMock = static_cast<OCMockObject*>(tab_.get());
|
| ios::ChromeBrowserState* ptr = chrome_browser_state_.get();
|
| [[[tabMock stub] andReturnValue:OCMOCK_VALUE(ptr)] browserState];
|
| @@ -470,8 +488,10 @@ void TearDown() override {
|
| GURL expectedUrl("http://www.testurl.net");
|
| NSString* expectedTitle = @"title";
|
| // Sets WebState to nil because [tab close] clears the WebState.
|
| - [static_cast<BVCTestTabMock*>(tab_.get()) setWebState:nil];
|
| - [static_cast<BVCTestTabMock*>(tab_.get()) setUrl:expectedUrl];
|
| + static_cast<BVCTestTabMock*>(tab_.get()).webState = nil;
|
| + static_cast<BVCTestTabMock*>(tab_.get()).url = expectedUrl;
|
| + static_cast<BVCTestTabMock*>(tab_.get()).lastCommittedURL = expectedUrl;
|
| + static_cast<BVCTestTabMock*>(tab_.get()).visibleURL = expectedUrl;
|
| OCMockObject* tabMock = static_cast<OCMockObject*>(tab_.get());
|
| [[[tabMock stub] andReturn:expectedTitle] title];
|
| [[[tabMock stub] andReturn:expectedTitle] originalTitle];
|
|
|