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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 signin->SetAuthenticatedUsername(username); | 687 signin->SetAuthenticatedUsername(username); |
688 ProfileSyncService* sync = | 688 ProfileSyncService* sync = |
689 ProfileSyncServiceFactory::GetForProfile(profile()); | 689 ProfileSyncServiceFactory::GetForProfile(profile()); |
690 sync->SetSyncSetupCompleted(); | 690 sync->SetSyncSetupCompleted(); |
691 // Force an auth error. | 691 // Force an auth error. |
692 FakeAuthStatusProvider provider( | 692 FakeAuthStatusProvider provider( |
693 ProfileOAuth2TokenServiceFactory::GetForProfile(profile())-> | 693 ProfileOAuth2TokenServiceFactory::GetForProfile(profile())-> |
694 signin_error_controller()); | 694 signin_error_controller()); |
695 GoogleServiceAuthError error( | 695 GoogleServiceAuthError error( |
696 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); | 696 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); |
697 provider.SetAuthError("user@gmail.com", error); | 697 provider.SetAuthError("user@gmail.com", "user@gmail.com", error); |
698 [BrowserWindowController updateSigninItem:syncMenuItem | 698 [BrowserWindowController updateSigninItem:syncMenuItem |
699 shouldShow:YES | 699 shouldShow:YES |
700 currentProfile:profile()]; | 700 currentProfile:profile()]; |
701 NSString* authError = | 701 NSString* authError = |
702 l10n_util::GetNSStringWithFixup(IDS_SYNC_SIGN_IN_ERROR_WRENCH_MENU_ITEM); | 702 l10n_util::GetNSStringWithFixup(IDS_SYNC_SIGN_IN_ERROR_WRENCH_MENU_ITEM); |
703 EXPECT_TRUE([[syncMenuItem title] isEqualTo:authError]); | 703 EXPECT_TRUE([[syncMenuItem title] isEqualTo:authError]); |
704 EXPECT_FALSE([syncMenuItem isHidden]); | 704 EXPECT_FALSE([syncMenuItem isHidden]); |
705 | 705 |
706 } | 706 } |
707 | 707 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 testFullscreenWindow_.reset( | 879 testFullscreenWindow_.reset( |
880 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) | 880 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) |
881 styleMask:NSBorderlessWindowMask | 881 styleMask:NSBorderlessWindowMask |
882 backing:NSBackingStoreBuffered | 882 backing:NSBackingStoreBuffered |
883 defer:NO]); | 883 defer:NO]); |
884 return testFullscreenWindow_.get(); | 884 return testFullscreenWindow_.get(); |
885 } | 885 } |
886 @end | 886 @end |
887 | 887 |
888 /* TODO(???): test other methods of BrowserWindowController */ | 888 /* TODO(???): test other methods of BrowserWindowController */ |
OLD | NEW |