| Index: chrome/browser/sync/sync_global_error_unittest.cc
|
| diff --git a/chrome/browser/sync/sync_global_error_unittest.cc b/chrome/browser/sync/sync_global_error_unittest.cc
|
| index 53374b29a1c9413664cb655a36e783891d5850ff..d7eab6e428727b286fd2e2a9130787bc710af6c7 100644
|
| --- a/chrome/browser/sync/sync_global_error_unittest.cc
|
| +++ b/chrome/browser/sync/sync_global_error_unittest.cc
|
| @@ -7,6 +7,8 @@
|
| #include "base/basictypes.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/browser/sync/profile_sync_service_mock.h"
|
| +#include "chrome/browser/sync/signin_manager.h"
|
| +#include "chrome/test/base/testing_profile.h"
|
| #include "content/test/test_browser_thread.h"
|
| #include "testing/gmock/include/gmock/gmock-actions.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| @@ -28,13 +30,6 @@ void VerifySyncGlobalErrorResult(NiceMock<ProfileSyncServiceMock>* service,
|
| bool is_error) {
|
| EXPECT_CALL(*service, HasSyncSetupCompleted())
|
| .WillRepeatedly(Return(is_signed_in));
|
| - if (error_state == GoogleServiceAuthError::SERVICE_UNAVAILABLE) {
|
| - EXPECT_CALL(*service, GetAuthenticatedUsername())
|
| - .WillRepeatedly(Return(UTF8ToUTF16("")));
|
| - } else {
|
| - EXPECT_CALL(*service, GetAuthenticatedUsername())
|
| - .WillRepeatedly(Return(UTF8ToUTF16("foo")));
|
| - }
|
|
|
| GoogleServiceAuthError auth_error(error_state);
|
| EXPECT_CALL(*service, GetAuthError()).WillRepeatedly(ReturnRef(auth_error));
|
| @@ -74,7 +69,9 @@ void VerifySyncGlobalErrorResult(NiceMock<ProfileSyncServiceMock>* service,
|
| TEST(SyncGlobalErrorTest, PassphraseGlobalError) {
|
| MessageLoopForUI message_loop;
|
| content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
|
| - NiceMock<ProfileSyncServiceMock> service;
|
| + scoped_ptr<Profile> profile(
|
| + ProfileSyncServiceMock::MakeSignedInTestingProfile());
|
| + NiceMock<ProfileSyncServiceMock> service(profile.get());
|
| SyncGlobalError error(&service);
|
|
|
| EXPECT_CALL(service, IsPassphraseRequired())
|
| @@ -91,7 +88,9 @@ TEST(SyncGlobalErrorTest, PassphraseGlobalError) {
|
| TEST(SyncGlobalErrorTest, AuthStateGlobalError) {
|
| MessageLoopForUI message_loop;
|
| content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop);
|
| - NiceMock<ProfileSyncServiceMock> service;
|
| + scoped_ptr<Profile> profile(
|
| + ProfileSyncServiceMock::MakeSignedInTestingProfile());
|
| + NiceMock<ProfileSyncServiceMock> service(profile.get());
|
| SyncGlobalError error(&service);
|
|
|
| browser_sync::SyncBackendHost::Status status;
|
|
|