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

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller_unittest.mm

Issue 2655463014: Pass the correct webState to the nativeContent. (Closed)
Patch Set: s/ithW// 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 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 #import <PassKit/PassKit.h> 6 #import <PassKit/PassKit.h>
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 NSNotification* notification = 320 NSNotification* notification =
321 [NSNotification notificationWithName:kTabModelTabDeselectedNotification 321 [NSNotification notificationWithName:kTabModelTabDeselectedNotification
322 object:nil 322 object:nil
323 userInfo:userInfoWithThisTab]; 323 userInfo:userInfoWithThisTab];
324 [bvc_ tabDeselected:notification]; 324 [bvc_ tabDeselected:notification];
325 EXPECT_OCMOCK_VERIFY(tabMock); 325 EXPECT_OCMOCK_VERIFY(tabMock);
326 } 326 }
327 327
328 TEST_F(BrowserViewControllerTest, TestNativeContentController) { 328 TEST_F(BrowserViewControllerTest, TestNativeContentController) {
329 id<CRWNativeContent> controller = 329 id<CRWNativeContent> controller =
330 [bvc_ controllerForURL:GURL(kChromeUINewTabURL)]; 330 [bvc_ controllerForURL:GURL(kChromeUINewTabURL)
331 webState:webStateImpl_.get()];
331 EXPECT_TRUE(controller != nil); 332 EXPECT_TRUE(controller != nil);
332 EXPECT_TRUE([controller isMemberOfClass:[NewTabPageController class]]); 333 EXPECT_TRUE([controller isMemberOfClass:[NewTabPageController class]]);
333 334
334 controller = [bvc_ controllerForURL:GURL(kChromeUISettingsURL)]; 335 controller = [bvc_ controllerForURL:GURL(kChromeUISettingsURL)
336 webState:webStateImpl_.get()];
335 EXPECT_TRUE(controller != nil); 337 EXPECT_TRUE(controller != nil);
336 EXPECT_TRUE([controller isMemberOfClass:[PageNotAvailableController class]]); 338 EXPECT_TRUE([controller isMemberOfClass:[PageNotAvailableController class]]);
337 } 339 }
338 340
339 TEST_F(BrowserViewControllerTest, TestErrorController) { 341 TEST_F(BrowserViewControllerTest, TestErrorController) {
340 const GURL badUrl("http://floofywhizbangzzz.com"); 342 const GURL badUrl("http://floofywhizbangzzz.com");
341 NSString* badURLString = base::SysUTF8ToNSString(badUrl.spec()); 343 NSString* badURLString = base::SysUTF8ToNSString(badUrl.spec());
342 NSDictionary* userInfoDic = [NSDictionary 344 NSDictionary* userInfoDic = [NSDictionary
343 dictionaryWithObjectsAndKeys:badURLString, 345 dictionaryWithObjectsAndKeys:badURLString,
344 NSURLErrorFailingURLStringErrorKey, 346 NSURLErrorFailingURLStringErrorKey,
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 OCMockObject* shareControllerMock = (OCMockObject*)shareController_.get(); 527 OCMockObject* shareControllerMock = (OCMockObject*)shareController_.get();
526 [[shareControllerMock expect] cancelShareAnimated:NO]; 528 [[shareControllerMock expect] cancelShareAnimated:NO];
527 EXPECT_CALL(*this, OnCompletionCalled()); 529 EXPECT_CALL(*this, OnCompletionCalled());
528 [bvc_ clearPresentedStateWithCompletion:^{ 530 [bvc_ clearPresentedStateWithCompletion:^{
529 this->OnCompletionCalled(); 531 this->OnCompletionCalled();
530 }]; 532 }];
531 EXPECT_OCMOCK_VERIFY(shareControllerMock); 533 EXPECT_OCMOCK_VERIFY(shareControllerMock);
532 } 534 }
533 535
534 } // namespace 536 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698