| 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_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
| 6 #define CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 6 #define CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_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/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "chrome/browser/signin/token_service.h" | 14 #include "chrome/browser/signin/token_service.h" |
| 15 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 15 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
| 16 #include "content/public/test/test_browser_thread.h" | 16 #include "content/public/test/test_browser_thread.h" |
| 17 #include "sync/internal_api/public/base/model_type.h" | 17 #include "sync/internal_api/public/base/model_type.h" |
| 18 #include "sync/internal_api/public/change_record.h" | 18 #include "sync/internal_api/public/change_record.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 | 20 |
| 21 class ProfileSyncService; | 21 class ProfileSyncService; |
| 22 class TestProfileSyncService; | 22 class TestProfileSyncService; |
| 23 | 23 |
| 24 namespace syncer { | 24 namespace syncer { |
| 25 class TestIdFactory; | |
| 26 } // namespace syncer | |
| 27 | |
| 28 namespace syncer { | |
| 29 struct UserShare; | 25 struct UserShare; |
| 30 } // namespace syncer | 26 } // namespace syncer |
| 31 | 27 |
| 32 class ProfileSyncServiceTestHelper { | 28 class ProfileSyncServiceTestHelper { |
| 33 public: | 29 public: |
| 34 static const std::string GetTagForType(syncer::ModelType model_type); | |
| 35 | |
| 36 static bool CreateRoot(syncer::ModelType model_type, | |
| 37 syncer::UserShare* service, | |
| 38 syncer::TestIdFactory* ids); | |
| 39 | |
| 40 static syncer::ImmutableChangeRecordList MakeSingletonChangeRecordList( | 30 static syncer::ImmutableChangeRecordList MakeSingletonChangeRecordList( |
| 41 int64 node_id, syncer::ChangeRecord::Action action); | 31 int64 node_id, syncer::ChangeRecord::Action action); |
| 42 | 32 |
| 43 // Deletions must provide an EntitySpecifics for the deleted data. | 33 // Deletions must provide an EntitySpecifics for the deleted data. |
| 44 static syncer::ImmutableChangeRecordList | 34 static syncer::ImmutableChangeRecordList |
| 45 MakeSingletonDeletionChangeRecordList( | 35 MakeSingletonDeletionChangeRecordList( |
| 46 int64 node_id, | 36 int64 node_id, |
| 47 const sync_pb::EntitySpecifics& specifics); | 37 const sync_pb::EntitySpecifics& specifics); |
| 48 }; | 38 }; |
| 49 | 39 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 private: | 71 private: |
| 82 void CreateRootCallback(); | 72 void CreateRootCallback(); |
| 83 | 73 |
| 84 base::Closure callback_; | 74 base::Closure callback_; |
| 85 AbstractProfileSyncServiceTest* test_; | 75 AbstractProfileSyncServiceTest* test_; |
| 86 syncer::ModelType model_type_; | 76 syncer::ModelType model_type_; |
| 87 bool success_; | 77 bool success_; |
| 88 }; | 78 }; |
| 89 | 79 |
| 90 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 80 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
| OLD | NEW |