| 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 #include "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/browser/sync/glue/data_type_manager.h" | 11 #include "chrome/browser/sync/glue/data_type_manager.h" |
| 12 #include "chrome/browser/sync/glue/data_type_manager_mock.h" | 12 #include "chrome/browser/sync/glue/data_type_manager_mock.h" |
| 13 #include "chrome/browser/sync/profile_sync_factory_mock.h" | 13 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
| 14 #include "chrome/browser/sync/profile_sync_test_util.h" | 14 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 15 #include "chrome/browser/sync/signin_manager.h" | 15 #include "chrome/browser/sync/signin_manager.h" |
| 16 #include "chrome/browser/sync/test_profile_sync_service.h" | 16 #include "chrome/browser/sync/test_profile_sync_service.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 18 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
| 19 #include "chrome/common/net/gaia/gaia_constants.h" | 19 #include "chrome/common/net/gaia/gaia_constants.h" |
| 20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 21 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
| 22 #include "content/test/test_browser_thread.h" | 22 #include "content/test/test_browser_thread.h" |
| 23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 DataTypeManagerMock* data_type_manager = new DataTypeManagerMock(); | 74 DataTypeManagerMock* data_type_manager = new DataTypeManagerMock(); |
| 75 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). | 75 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). |
| 76 WillOnce(Return(data_type_manager)); | 76 WillOnce(Return(data_type_manager)); |
| 77 return data_type_manager; | 77 return data_type_manager; |
| 78 } | 78 } |
| 79 | 79 |
| 80 MessageLoop ui_loop_; | 80 MessageLoop ui_loop_; |
| 81 content::TestBrowserThread ui_thread_; | 81 content::TestBrowserThread ui_thread_; |
| 82 content::TestBrowserThread io_thread_; | 82 content::TestBrowserThread io_thread_; |
| 83 scoped_ptr<TestingProfile> profile_; | 83 scoped_ptr<TestingProfile> profile_; |
| 84 ProfileSyncFactoryMock factory_; | 84 ProfileSyncComponentsFactoryMock factory_; |
| 85 scoped_ptr<TestProfileSyncService> service_; | 85 scoped_ptr<TestProfileSyncService> service_; |
| 86 ProfileSyncServiceObserverMock observer_; | 86 ProfileSyncServiceObserverMock observer_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest { | 89 class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest { |
| 90 protected: | 90 protected: |
| 91 virtual void CreateSyncService() { | 91 virtual void CreateSyncService() { |
| 92 service_.reset(new TestProfileSyncService(&factory_, profile_.get(), | 92 service_.reset(new TestProfileSyncService(&factory_, profile_.get(), |
| 93 "test_user", true, NULL)); | 93 "test_user", true, NULL)); |
| 94 } | 94 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 // Preload the tokens. | 306 // Preload the tokens. |
| 307 profile_->GetTokenService()->IssueAuthTokenForTest( | 307 profile_->GetTokenService()->IssueAuthTokenForTest( |
| 308 GaiaConstants::kSyncService, "sync_token"); | 308 GaiaConstants::kSyncService, "sync_token"); |
| 309 service_->fail_initial_download(); | 309 service_->fail_initial_download(); |
| 310 | 310 |
| 311 service_->Initialize(); | 311 service_->Initialize(); |
| 312 EXPECT_FALSE(service_->sync_initialized()); | 312 EXPECT_FALSE(service_->sync_initialized()); |
| 313 EXPECT_FALSE(service_->GetBackendForTest()); | 313 EXPECT_FALSE(service_->GetBackendForTest()); |
| 314 } | 314 } |
| OLD | NEW |