| OLD | NEW |
| 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/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 [BrowserWindowController updateSigninItem:syncMenuItem | 653 [BrowserWindowController updateSigninItem:syncMenuItem |
| 654 shouldShow:NO | 654 shouldShow:NO |
| 655 currentProfile:profile()]; | 655 currentProfile:profile()]; |
| 656 EXPECT_TRUE([[syncMenuItem title] isEqualTo:startSignin]); | 656 EXPECT_TRUE([[syncMenuItem title] isEqualTo:startSignin]); |
| 657 EXPECT_TRUE([syncMenuItem isHidden]); | 657 EXPECT_TRUE([syncMenuItem isHidden]); |
| 658 | 658 |
| 659 // Now sign in. | 659 // Now sign in. |
| 660 std::string username = "foo@example.com"; | 660 std::string username = "foo@example.com"; |
| 661 NSString* alreadySignedIn = | 661 NSString* alreadySignedIn = |
| 662 l10n_util::GetNSStringFWithFixup(IDS_SYNC_MENU_SYNCED_LABEL, | 662 l10n_util::GetNSStringFWithFixup(IDS_SYNC_MENU_SYNCED_LABEL, |
| 663 UTF8ToUTF16(username)); | 663 base::UTF8ToUTF16(username)); |
| 664 SigninManager* signin = SigninManagerFactory::GetForProfile(profile()); | 664 SigninManager* signin = SigninManagerFactory::GetForProfile(profile()); |
| 665 signin->SetAuthenticatedUsername(username); | 665 signin->SetAuthenticatedUsername(username); |
| 666 ProfileSyncService* sync = | 666 ProfileSyncService* sync = |
| 667 ProfileSyncServiceFactory::GetForProfile(profile()); | 667 ProfileSyncServiceFactory::GetForProfile(profile()); |
| 668 sync->SetSyncSetupCompleted(); | 668 sync->SetSyncSetupCompleted(); |
| 669 [BrowserWindowController updateSigninItem:syncMenuItem | 669 [BrowserWindowController updateSigninItem:syncMenuItem |
| 670 shouldShow:YES | 670 shouldShow:YES |
| 671 currentProfile:profile()]; | 671 currentProfile:profile()]; |
| 672 EXPECT_TRUE([[syncMenuItem title] isEqualTo:alreadySignedIn]); | 672 EXPECT_TRUE([[syncMenuItem title] isEqualTo:alreadySignedIn]); |
| 673 EXPECT_FALSE([syncMenuItem isHidden]); | 673 EXPECT_FALSE([syncMenuItem isHidden]); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 testFullscreenWindow_.reset( | 876 testFullscreenWindow_.reset( |
| 877 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) | 877 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) |
| 878 styleMask:NSBorderlessWindowMask | 878 styleMask:NSBorderlessWindowMask |
| 879 backing:NSBackingStoreBuffered | 879 backing:NSBackingStoreBuffered |
| 880 defer:NO]); | 880 defer:NO]); |
| 881 return testFullscreenWindow_.get(); | 881 return testFullscreenWindow_.get(); |
| 882 } | 882 } |
| 883 @end | 883 @end |
| 884 | 884 |
| 885 /* TODO(???): test other methods of BrowserWindowController */ | 885 /* TODO(???): test other methods of BrowserWindowController */ |
| OLD | NEW |