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 COMPONENTS_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 5 #ifndef COMPONENTS_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
6 #define COMPONENTS_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 6 #define COMPONENTS_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ~AbstractProfileSyncServiceTest() override; | 49 ~AbstractProfileSyncServiceTest() override; |
50 | 50 |
51 bool CreateRoot(syncer::ModelType model_type); | 51 bool CreateRoot(syncer::ModelType model_type); |
52 | 52 |
53 protected: | 53 protected: |
54 // Creates a TestProfileSyncService instance based on | 54 // Creates a TestProfileSyncService instance based on |
55 // |profile_sync_service_bundle_|, with start behavior AUTO_START. Passes | 55 // |profile_sync_service_bundle_|, with start behavior AUTO_START. Passes |
56 // |callback| down to SyncManagerForProfileSyncTest to be used by | 56 // |callback| down to SyncManagerForProfileSyncTest to be used by |
57 // NotifyInitializationSuccess. |sync_client| is passed to the service. The | 57 // NotifyInitializationSuccess. |sync_client| is passed to the service. The |
58 // created service is stored in |sync_service_|. | 58 // created service is stored in |sync_service_|. |
59 void CreateSyncService(std::unique_ptr<sync_driver::SyncClient> sync_client, | 59 void CreateSyncService(std::unique_ptr<syncer::SyncClient> sync_client, |
60 const base::Closure& initialization_success_callback); | 60 const base::Closure& initialization_success_callback); |
61 | 61 |
62 base::Thread* data_type_thread() { return &data_type_thread_; } | 62 base::Thread* data_type_thread() { return &data_type_thread_; } |
63 | 63 |
64 TestProfileSyncService* sync_service() { return sync_service_.get(); } | 64 TestProfileSyncService* sync_service() { return sync_service_.get(); } |
65 | 65 |
66 // Returns the callback for the FakeSyncClient builder. It is not possible to | 66 // Returns the callback for the FakeSyncClient builder. It is not possible to |
67 // just Bind() sync_service(), because of Callback not understanding the | 67 // just Bind() sync_service(), because of Callback not understanding the |
68 // inheritance of its template arguments. | 68 // inheritance of its template arguments. |
69 base::Callback<sync_driver::SyncService*(void)> GetSyncServiceCallback(); | 69 base::Callback<syncer::SyncService*(void)> GetSyncServiceCallback(); |
70 | 70 |
71 ProfileSyncServiceBundle* profile_sync_service_bundle() { | 71 ProfileSyncServiceBundle* profile_sync_service_bundle() { |
72 return &profile_sync_service_bundle_; | 72 return &profile_sync_service_bundle_; |
73 } | 73 } |
74 | 74 |
75 private: | 75 private: |
76 // Use |data_type_thread_| for code disallowed on the UI thread. | 76 // Use |data_type_thread_| for code disallowed on the UI thread. |
77 base::Thread data_type_thread_; | 77 base::Thread data_type_thread_; |
78 | 78 |
79 base::TestMessageLoop message_loop_; | 79 base::TestMessageLoop message_loop_; |
(...skipping 21 matching lines...) Expand all Loading... |
101 AbstractProfileSyncServiceTest* test_; | 101 AbstractProfileSyncServiceTest* test_; |
102 syncer::ModelType model_type_; | 102 syncer::ModelType model_type_; |
103 bool success_; | 103 bool success_; |
104 | 104 |
105 DISALLOW_COPY_AND_ASSIGN(CreateRootHelper); | 105 DISALLOW_COPY_AND_ASSIGN(CreateRootHelper); |
106 }; | 106 }; |
107 | 107 |
108 } // namespace browser_sync | 108 } // namespace browser_sync |
109 | 109 |
110 #endif // COMPONENTS_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 110 #endif // COMPONENTS_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
OLD | NEW |