| 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 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" | 13 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" |
| 14 #include "chrome/browser/sync/profile_sync_service.h" | 14 #include "chrome/browser/sync/profile_sync_service.h" |
| 15 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 15 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 16 #include "components/sync_driver/data_type_manager_impl.h" | 16 #include "components/sync_driver/data_type_manager_impl.h" |
| 17 #include "components/sync_driver/sync_prefs.h" | 17 #include "components/sync_driver/sync_prefs.h" |
| 18 #include "sync/test/engine/test_id_factory.h" | 18 #include "sync/test/engine/test_id_factory.h" |
| 19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 20 | 20 |
| 21 class Profile; | 21 class Profile; |
| 22 class ProfileOAuth2TokenService; | 22 class ProfileOAuth2TokenService; |
| 23 class ProfileSyncComponentsFactory; | |
| 24 class ProfileSyncComponentsFactoryMock; | 23 class ProfileSyncComponentsFactoryMock; |
| 25 | 24 |
| 26 ACTION(ReturnNewDataTypeManager) { | 25 ACTION(ReturnNewDataTypeManager) { |
| 27 return new sync_driver::DataTypeManagerImpl(base::Closure(), | 26 return new sync_driver::DataTypeManagerImpl(base::Closure(), |
| 28 arg0, | 27 arg0, |
| 29 arg1, | 28 arg1, |
| 30 arg2, | 29 arg2, |
| 31 arg3, | 30 arg3, |
| 32 arg4); | 31 arg4); |
| 33 } | 32 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 base::Closure callback_; | 64 base::Closure callback_; |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace browser_sync | 67 } // namespace browser_sync |
| 69 | 68 |
| 70 class TestProfileSyncService : public ProfileSyncService { | 69 class TestProfileSyncService : public ProfileSyncService { |
| 71 public: | 70 public: |
| 72 // TODO(tim): Add ability to inject TokenService alongside SigninManager. | 71 // TODO(tim): Add ability to inject TokenService alongside SigninManager. |
| 73 // TODO(rogerta): what does above comment mean? | 72 // TODO(rogerta): what does above comment mean? |
| 74 TestProfileSyncService( | 73 TestProfileSyncService( |
| 75 scoped_ptr<ProfileSyncComponentsFactory> factory, | 74 scoped_ptr<sync_driver::SyncApiComponentFactory> factory, |
| 76 Profile* profile, | 75 Profile* profile, |
| 77 SigninManagerBase* signin, | 76 SigninManagerBase* signin, |
| 78 ProfileOAuth2TokenService* oauth2_token_service, | 77 ProfileOAuth2TokenService* oauth2_token_service, |
| 79 browser_sync::ProfileSyncServiceStartBehavior behavior); | 78 browser_sync::ProfileSyncServiceStartBehavior behavior); |
| 80 | 79 |
| 81 ~TestProfileSyncService() override; | 80 ~TestProfileSyncService() override; |
| 82 | 81 |
| 83 void OnConfigureDone( | 82 void OnConfigureDone( |
| 84 const sync_driver::DataTypeManager::ConfigureResult& result) override; | 83 const sync_driver::DataTypeManager::ConfigureResult& result) override; |
| 85 | 84 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 105 // and cause memory leak in test. | 104 // and cause memory leak in test. |
| 106 syncer::WeakHandle<syncer::JsEventHandler> GetJsEventHandler() override; | 105 syncer::WeakHandle<syncer::JsEventHandler> GetJsEventHandler() override; |
| 107 | 106 |
| 108 bool NeedBackup() const override; | 107 bool NeedBackup() const override; |
| 109 | 108 |
| 110 private: | 109 private: |
| 111 syncer::TestIdFactory id_factory_; | 110 syncer::TestIdFactory id_factory_; |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 113 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |