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

Side by Side Diff: chrome/browser/sync/sync_global_error_unittest.cc

Issue 12502017: signin: pull basic SigninManager functionality into new SigninManagerBase class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: deal with new enterprise_platform_keys_private_api Created 7 years, 8 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
« no previous file with comments | « chrome/browser/sync/sync_global_error.cc ('k') | chrome/browser/sync/sync_ui_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/sync/sync_global_error.h" 5 #include "chrome/browser/sync/sync_global_error.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/signin/signin_manager.h" 10 #include "chrome/browser/signin/signin_manager.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 #endif 152 #endif
153 } 153 }
154 154
155 } // namespace 155 } // namespace
156 156
157 // Test that SyncGlobalError shows an error if a passphrase is required. 157 // Test that SyncGlobalError shows an error if a passphrase is required.
158 TEST_F(SyncGlobalErrorTest, PassphraseGlobalError) { 158 TEST_F(SyncGlobalErrorTest, PassphraseGlobalError) {
159 scoped_ptr<Profile> profile( 159 scoped_ptr<Profile> profile(
160 ProfileSyncServiceMock::MakeSignedInTestingProfile()); 160 ProfileSyncServiceMock::MakeSignedInTestingProfile());
161 NiceMock<ProfileSyncServiceMock> service(profile.get()); 161 NiceMock<ProfileSyncServiceMock> service(profile.get());
162 SigninManager* signin = SigninManagerFactory::GetForProfile(profile.get()); 162 SigninManagerBase* signin =
163 SigninManagerFactory::GetForProfile(profile.get());
163 FakeLoginUIService* login_ui_service = static_cast<FakeLoginUIService*>( 164 FakeLoginUIService* login_ui_service = static_cast<FakeLoginUIService*>(
164 LoginUIServiceFactory::GetInstance()->SetTestingFactoryAndUse( 165 LoginUIServiceFactory::GetInstance()->SetTestingFactoryAndUse(
165 profile.get(), BuildMockLoginUIService)); 166 profile.get(), BuildMockLoginUIService));
166 FakeLoginUI login_ui; 167 FakeLoginUI login_ui;
167 login_ui_service->SetLoginUI(&login_ui); 168 login_ui_service->SetLoginUI(&login_ui);
168 SyncGlobalError error(&service, signin); 169 SyncGlobalError error(&service, signin);
169 170
170 browser_sync::SyncBackendHost::Status status; 171 browser_sync::SyncBackendHost::Status status;
171 EXPECT_CALL(service, QueryDetailedSyncStatus(_)) 172 EXPECT_CALL(service, QueryDetailedSyncStatus(_))
172 .WillRepeatedly(Return(false)); 173 .WillRepeatedly(Return(false));
173 174
174 EXPECT_CALL(service, IsPassphraseRequired()) 175 EXPECT_CALL(service, IsPassphraseRequired())
175 .WillRepeatedly(Return(true)); 176 .WillRepeatedly(Return(true));
176 EXPECT_CALL(service, IsPassphraseRequiredForDecryption()) 177 EXPECT_CALL(service, IsPassphraseRequiredForDecryption())
177 .WillRepeatedly(Return(true)); 178 .WillRepeatedly(Return(true));
178 VerifySyncGlobalErrorResult( 179 VerifySyncGlobalErrorResult(
179 &service, login_ui_service, browser(), &error, 180 &service, login_ui_service, browser(), &error,
180 GoogleServiceAuthError::NONE, true, true); 181 GoogleServiceAuthError::NONE, true, true);
181 } 182 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/sync_global_error.cc ('k') | chrome/browser/sync/sync_ui_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698