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 #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 Loading... |
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 } |
OLD | NEW |