| Index: chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller_browsertest.mm
|
| diff --git a/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller_browsertest.mm b/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller_browsertest.mm
|
| index 6380427327b8719898c592ac26bf818b518b1cf0..4311f676cfe97f44e8b5c465d0c169a6c2a47c50 100644
|
| --- a/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller_browsertest.mm
|
| +++ b/chrome/browser/ui/cocoa/profiles/profile_signin_confirmation_view_controller_browsertest.mm
|
| @@ -18,10 +18,32 @@
|
| #import "testing/gtest_mac.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
|
|
| -class ProfileSigninConfirmationViewControllerTest
|
| - : public InProcessBrowserTest,
|
| - public ui::ProfileSigninConfirmationDelegate {
|
| +@interface ProfileSigninConfirmationViewController (TestingAPI)
|
| +
|
| +@property(readonly, nonatomic) ui::ProfileSigninConfirmationDelegate* delegate;
|
| +@property(readonly, nonatomic) NSButton* createProfileButton;
|
| +@property(readonly, nonatomic) NSTextView* explanationField;
|
| +
|
| +@end
|
| +
|
| +@implementation ProfileSigninConfirmationViewController (TestingAPI)
|
| +
|
| +- (ui::ProfileSigninConfirmationDelegate*)delegate {
|
| + return delegate_.get();
|
| +}
|
| +
|
| +- (NSButton*)createProfileButton {
|
| + return createProfileButton_.get();
|
| +}
|
|
|
| +- (NSTextView*)explanationField {
|
| + return explanationField_.get();
|
| +}
|
| +
|
| +@end
|
| +
|
| +class ProfileSigninConfirmationViewControllerTest
|
| + : public InProcessBrowserTest {
|
| public:
|
| ProfileSigninConfirmationViewControllerTest()
|
| : window_(nil),
|
| @@ -44,11 +66,11 @@ class ProfileSigninConfirmationViewControllerTest
|
| &ProfileSigninConfirmationViewControllerTest::OnClose,
|
| base::Unretained(this));
|
| controller_.reset([[ProfileSigninConfirmationViewController alloc]
|
| - initWithBrowser:browser()
|
| - username:username()
|
| - delegate:this
|
| - closeDialogCallback:close
|
| - offerProfileCreation:offerProfileCreation]);
|
| + initWithBrowser:browser()
|
| + username:username()
|
| + delegate:base::MakeUnique<TestSigninDelegate>(this)
|
| + closeDialogCallback:close
|
| + offerProfileCreation:offerProfileCreation]);
|
| [[window_ contentView] addSubview:[controller_ view]];
|
| [window_ makeKeyAndOrderFront:NSApp];
|
| ASSERT_TRUE([window_ isVisible]);
|
| @@ -63,10 +85,6 @@ class ProfileSigninConfirmationViewControllerTest
|
| IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE);
|
| }
|
|
|
| - // ui::ProfileSigninConfirmationDelegate:
|
| - void OnContinueSignin() override { continued_ = true; }
|
| - void OnCancelSignin() override { cancelled_ = true; }
|
| - void OnSigninWithNewProfile() override { created_ = true; }
|
| void OnClose() { closed_ = true; }
|
|
|
| // The window containing the dialog.
|
| @@ -82,6 +100,23 @@ class ProfileSigninConfirmationViewControllerTest
|
| bool closed_;
|
|
|
| private:
|
| + class TestSigninDelegate : public ui::ProfileSigninConfirmationDelegate {
|
| + public:
|
| + explicit TestSigninDelegate(
|
| + ProfileSigninConfirmationViewControllerTest* client)
|
| + : client_(client) {}
|
| +
|
| + // ui::ProfileSigninConfirmationDelegate:
|
| + void OnContinueSignin() override { client_->continued_ = true; }
|
| + void OnCancelSignin() override { client_->cancelled_ = true; }
|
| + void OnSigninWithNewProfile() override { client_->created_ = true; }
|
| +
|
| + private:
|
| + ProfileSigninConfirmationViewControllerTest* client_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TestSigninDelegate);
|
| + };
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ProfileSigninConfirmationViewControllerTest);
|
| };
|
|
|
|
|