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 <set> | 5 #include <set> |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/signin/fake_signin_manager.h" | 9 #include "chrome/browser/signin/fake_signin_manager.h" |
10 #include "chrome/browser/signin/signin_error_controller_factory.h" | 10 #include "chrome/browser/signin/signin_error_controller_factory.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 .WillRepeatedly(Return(true)); | 247 .WillRepeatedly(Return(true)); |
248 EXPECT_CALL(service, SyncActive()).WillRepeatedly(Return(true)); | 248 EXPECT_CALL(service, SyncActive()).WillRepeatedly(Return(true)); |
249 EXPECT_CALL(service, IsPassphraseRequired()) | 249 EXPECT_CALL(service, IsPassphraseRequired()) |
250 .WillRepeatedly(Return(false)); | 250 .WillRepeatedly(Return(false)); |
251 browser_sync::SyncBackendHost::Status status; | 251 browser_sync::SyncBackendHost::Status status; |
252 EXPECT_CALL(service, QueryDetailedSyncStatus(_)) | 252 EXPECT_CALL(service, QueryDetailedSyncStatus(_)) |
253 .WillRepeatedly(DoAll(SetArgPointee<0>(status), | 253 .WillRepeatedly(DoAll(SetArgPointee<0>(status), |
254 Return(false))); | 254 Return(false))); |
255 provider->SetAuthError( | 255 provider->SetAuthError( |
256 signin->GetAuthenticatedAccountId(), | 256 signin->GetAuthenticatedAccountId(), |
257 kTestUser, | |
258 GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE)); | 257 GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE)); |
259 EXPECT_CALL(service, HasUnrecoverableError()) | 258 EXPECT_CALL(service, HasUnrecoverableError()) |
260 .WillRepeatedly(Return(false)); | 259 .WillRepeatedly(Return(false)); |
261 return; | 260 return; |
262 } | 261 } |
263 case STATUS_CASE_PROTOCOL_ERROR: { | 262 case STATUS_CASE_PROTOCOL_ERROR: { |
264 EXPECT_CALL(service, HasSyncSetupCompleted()) | 263 EXPECT_CALL(service, HasSyncSetupCompleted()) |
265 .WillRepeatedly(Return(true)); | 264 .WillRepeatedly(Return(true)); |
266 EXPECT_CALL(service, SyncActive()).WillRepeatedly(Return(true)); | 265 EXPECT_CALL(service, SyncActive()).WillRepeatedly(Return(true)); |
267 EXPECT_CALL(service, IsPassphraseRequired()) | 266 EXPECT_CALL(service, IsPassphraseRequired()) |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 EXPECT_FALSE(status_label.empty()); | 396 EXPECT_FALSE(status_label.empty()); |
398 EXPECT_EQ(status_label.find(base::ASCIIToUTF16("href")), | 397 EXPECT_EQ(status_label.find(base::ASCIIToUTF16("href")), |
399 base::string16::npos); | 398 base::string16::npos); |
400 testing::Mock::VerifyAndClearExpectations(&service); | 399 testing::Mock::VerifyAndClearExpectations(&service); |
401 testing::Mock::VerifyAndClearExpectations(&signin); | 400 testing::Mock::VerifyAndClearExpectations(&signin); |
402 EXPECT_CALL(service, GetAuthError()).WillRepeatedly(ReturnRef(error)); | 401 EXPECT_CALL(service, GetAuthError()).WillRepeatedly(ReturnRef(error)); |
403 provider.reset(); | 402 provider.reset(); |
404 signin.Shutdown(); | 403 signin.Shutdown(); |
405 } | 404 } |
406 } | 405 } |
OLD | NEW |