OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" | 5 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
9 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
10 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h" | 10 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/test/base/in_process_browser_test.h" | 12 #include "chrome/test/base/in_process_browser_test.h" |
13 #import "testing/gtest_mac.h" | 13 #import "testing/gtest_mac.h" |
14 | 14 |
15 class OneClickSigninBubbleControllerTest : public InProcessBrowserTest { | 15 class OneClickSigninBubbleControllerTest : public InProcessBrowserTest { |
16 public: | 16 public: |
17 OneClickSigninBubbleControllerTest() | 17 OneClickSigninBubbleControllerTest() |
18 : controller_(NULL), | 18 : controller_(NULL), |
19 callback_count_(0) { | 19 callback_count_(0) { |
20 } | 20 } |
21 | 21 |
22 protected: | 22 protected: |
23 virtual void SetUpOnMainThread() OVERRIDE { | 23 virtual void SetUpOnMainThread() override { |
24 content::WebContents* web_contents = | 24 content::WebContents* web_contents = |
25 browser()->tab_strip_model()->GetWebContentsAt(0); | 25 browser()->tab_strip_model()->GetWebContentsAt(0); |
26 BrowserWindow::StartSyncCallback callback = base::Bind( | 26 BrowserWindow::StartSyncCallback callback = base::Bind( |
27 &OneClickSigninBubbleControllerTest::OnStartSyncCallback, | 27 &OneClickSigninBubbleControllerTest::OnStartSyncCallback, |
28 base::Unretained(this)); | 28 base::Unretained(this)); |
29 | 29 |
30 BrowserWindowCocoa* browser_window = | 30 BrowserWindowCocoa* browser_window = |
31 static_cast<BrowserWindowCocoa*>(browser()->window()); | 31 static_cast<BrowserWindowCocoa*>(browser()->window()); |
32 controller_.reset([[OneClickSigninBubbleController alloc] | 32 controller_.reset([[OneClickSigninBubbleController alloc] |
33 initWithBrowserWindowController:browser_window->cocoa_controller() | 33 initWithBrowserWindowController:browser_window->cocoa_controller() |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 IN_PROC_BROWSER_TEST_F(OneClickSigninBubbleControllerTest, LearnMore) { | 84 IN_PROC_BROWSER_TEST_F(OneClickSigninBubbleControllerTest, LearnMore) { |
85 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 85 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
86 EXPECT_EQ(1, browser()->tab_strip_model()->count()); | 86 EXPECT_EQ(1, browser()->tab_strip_model()->count()); |
87 [[controller_ viewController] textView:nil | 87 [[controller_ viewController] textView:nil |
88 clickedOnLink:nil | 88 clickedOnLink:nil |
89 atIndex:0]; | 89 atIndex:0]; |
90 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); | 90 EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); |
91 EXPECT_EQ(2, browser()->tab_strip_model()->count()); | 91 EXPECT_EQ(2, browser()->tab_strip_model()->count()); |
92 EXPECT_EQ(0, callback_count_); | 92 EXPECT_EQ(0, callback_count_); |
93 } | 93 } |
OLD | NEW |