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

Side by Side Diff: chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm

Issue 10692195: Consolidate Browser Creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "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 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 14 matching lines...) Expand all
25 public: 25 public:
26 OneClickSigninBubbleControllerTest() 26 OneClickSigninBubbleControllerTest()
27 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)), 27 : weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
28 start_sync_callback_( 28 start_sync_callback_(
29 base::Bind(&OneClickSigninBubbleControllerTest::OnStartSync, 29 base::Bind(&OneClickSigninBubbleControllerTest::OnStartSync,
30 weak_ptr_factory_.GetWeakPtr())) {} 30 weak_ptr_factory_.GetWeakPtr())) {}
31 31
32 virtual void SetUp() { 32 virtual void SetUp() {
33 CocoaProfileTest::SetUp(); 33 CocoaProfileTest::SetUp();
34 BrowserWindowCocoa* browser_window = 34 BrowserWindowCocoa* browser_window =
35 static_cast<BrowserWindowCocoa*>(CreateBrowserWindow()); 35 static_cast<BrowserWindowCocoa*>(browser()->window());
36 controller_.reset( 36 controller_.reset(
37 [[OneClickSigninBubbleController alloc] 37 [[OneClickSigninBubbleController alloc]
38 initWithBrowserWindowController:browser_window->cocoa_controller() 38 initWithBrowserWindowController:browser_window->cocoa_controller()
39 start_sync_callback:start_sync_callback_]); 39 start_sync_callback:start_sync_callback_]);
40 } 40 }
41 41
42 virtual void TearDown() { 42 virtual void TearDown() {
43 controller_.reset(); 43 controller_.reset();
44 CocoaProfileTest::TearDown(); 44 CocoaProfileTest::TearDown();
45 } 45 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // Callback should be called to setup sync with default settings. 94 // Callback should be called to setup sync with default settings.
95 TEST_F(OneClickSigninBubbleControllerTest, ShowAndClose) { 95 TEST_F(OneClickSigninBubbleControllerTest, ShowAndClose) {
96 EXPECT_CALL(*this, OnStartSync( 96 EXPECT_CALL(*this, OnStartSync(
97 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS)).Times(1); 97 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS)).Times(1);
98 98
99 [controller_ showWindow:nil]; 99 [controller_ showWindow:nil];
100 [controller_.release() close]; 100 [controller_.release() close];
101 } 101 }
102 102
103 } // namespace 103 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698