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

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

Issue 288813003: Add username of account that has an auth error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 6 years, 7 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/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
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
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 */
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_ui_util_unittest.cc ('k') | chrome/browser/ui/webui/sync_setup_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698