| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 std::string username = "foo@example.com"; | 145 std::string username = "foo@example.com"; |
| 146 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); | 146 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
| 147 signin->SetAuthenticatedAccountInfo(username, username); | 147 signin->SetAuthenticatedAccountInfo(username, username); |
| 148 ProfileSyncService* sync = ProfileSyncServiceFactory::GetForProfile(profile_); | 148 ProfileSyncService* sync = ProfileSyncServiceFactory::GetForProfile(profile_); |
| 149 sync->SetSyncSetupCompleted(); | 149 sync->SetSyncSetupCompleted(); |
| 150 // Force an auth error. | 150 // Force an auth error. |
| 151 FakeAuthStatusProvider provider( | 151 FakeAuthStatusProvider provider( |
| 152 SigninErrorControllerFactory::GetForProfile(profile_)); | 152 SigninErrorControllerFactory::GetForProfile(profile_)); |
| 153 GoogleServiceAuthError error( | 153 GoogleServiceAuthError error( |
| 154 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); | 154 GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS); |
| 155 provider.SetAuthError("user@gmail.com", "user@gmail.com", error); | 155 provider.SetAuthError("user@gmail.com", error); |
| 156 [AppController updateSigninItem:syncMenuItem | 156 [AppController updateSigninItem:syncMenuItem |
| 157 shouldShow:YES | 157 shouldShow:YES |
| 158 currentProfile:profile_]; | 158 currentProfile:profile_]; |
| 159 NSString* authError = | 159 NSString* authError = |
| 160 l10n_util::GetNSStringWithFixup(IDS_SYNC_SIGN_IN_ERROR_WRENCH_MENU_ITEM); | 160 l10n_util::GetNSStringWithFixup(IDS_SYNC_SIGN_IN_ERROR_WRENCH_MENU_ITEM); |
| 161 EXPECT_TRUE([[syncMenuItem title] isEqualTo:authError]); | 161 EXPECT_TRUE([[syncMenuItem title] isEqualTo:authError]); |
| 162 EXPECT_FALSE([syncMenuItem isHidden]); | 162 EXPECT_FALSE([syncMenuItem isHidden]); |
| 163 } | 163 } |
| 164 | 164 |
| 165 // If there's a separator after the signin menu item, make sure it is hidden/ | 165 // If there's a separator after the signin menu item, make sure it is hidden/ |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 [followingNonSeparator setHidden:YES]; | 218 [followingNonSeparator setHidden:YES]; |
| 219 [AppController updateSigninItem:signinMenuItem | 219 [AppController updateSigninItem:signinMenuItem |
| 220 shouldShow:YES | 220 shouldShow:YES |
| 221 currentProfile:profile_]; | 221 currentProfile:profile_]; |
| 222 | 222 |
| 223 EXPECT_TRUE([followingNonSeparator isEnabled]); | 223 EXPECT_TRUE([followingNonSeparator isEnabled]); |
| 224 EXPECT_FALSE([signinMenuItem isHidden]); | 224 EXPECT_FALSE([signinMenuItem isHidden]); |
| 225 EXPECT_TRUE([followingNonSeparator isHidden]); | 225 EXPECT_TRUE([followingNonSeparator isHidden]); |
| 226 } | 226 } |
| OLD | NEW |