| 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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 static syncer::ImmutableChangeRecordList MakeSingletonChangeRecordList( | 30 static syncer::ImmutableChangeRecordList MakeSingletonChangeRecordList( |
| 31 int64 node_id, syncer::ChangeRecord::Action action); | 31 int64 node_id, syncer::ChangeRecord::Action action); |
| 32 | 32 |
| 33 // Deletions must provide an EntitySpecifics for the deleted data. | 33 // Deletions must provide an EntitySpecifics for the deleted data. |
| 34 static syncer::ImmutableChangeRecordList | 34 static syncer::ImmutableChangeRecordList |
| 35 MakeSingletonDeletionChangeRecordList( | 35 MakeSingletonDeletionChangeRecordList( |
| 36 int64 node_id, | 36 int64 node_id, |
| 37 const sync_pb::EntitySpecifics& specifics); | 37 const sync_pb::EntitySpecifics& specifics); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class AbstractProfileSyncServiceTest : public testing::Test { | 40 class BaseProfileSyncServiceTest { |
| 41 public: | 41 public: |
| 42 AbstractProfileSyncServiceTest(); | 42 BaseProfileSyncServiceTest(); |
| 43 virtual ~AbstractProfileSyncServiceTest(); | 43 virtual ~BaseProfileSyncServiceTest(); |
| 44 | 44 |
| 45 virtual void SetUp() OVERRIDE; | 45 virtual void SetUp(); |
| 46 | 46 |
| 47 virtual void TearDown() OVERRIDE; | 47 virtual void TearDown(); |
| 48 | 48 |
| 49 bool CreateRoot(syncer::ModelType model_type); | 49 bool CreateRoot(syncer::ModelType model_type); |
| 50 | 50 |
| 51 static ProfileKeyedService* BuildTokenService(Profile* profile); | 51 static ProfileKeyedService* BuildTokenService(Profile* profile); |
| 52 protected: | 52 protected: |
| 53 MessageLoopForUI ui_loop_; | 53 MessageLoopForUI ui_loop_; |
| 54 content::TestBrowserThread ui_thread_; | 54 content::TestBrowserThread ui_thread_; |
| 55 content::TestBrowserThread db_thread_; | 55 content::TestBrowserThread db_thread_; |
| 56 content::TestBrowserThread file_thread_; | 56 content::TestBrowserThread file_thread_; |
| 57 content::TestBrowserThread io_thread_; | 57 content::TestBrowserThread io_thread_; |
| 58 TokenService* token_service_; | 58 TokenService* token_service_; |
| 59 TestProfileSyncService* sync_service_; | 59 TestProfileSyncService* sync_service_; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 class AbstractProfileSyncServiceTest : public BaseProfileSyncServiceTest, |
| 63 public ::testing::Test { |
| 64 public: |
| 65 AbstractProfileSyncServiceTest(); |
| 66 virtual ~AbstractProfileSyncServiceTest(); |
| 67 |
| 68 virtual void SetUp() OVERRIDE; |
| 69 virtual void TearDown() OVERRIDE; |
| 70 }; |
| 71 |
| 62 class CreateRootHelper { | 72 class CreateRootHelper { |
| 63 public: | 73 public: |
| 64 CreateRootHelper(AbstractProfileSyncServiceTest* test, | 74 CreateRootHelper(BaseProfileSyncServiceTest* test, |
| 65 syncer::ModelType model_type); | 75 syncer::ModelType model_type); |
| 66 virtual ~CreateRootHelper(); | 76 virtual ~CreateRootHelper(); |
| 67 | 77 |
| 68 const base::Closure& callback() const; | 78 const base::Closure& callback() const; |
| 69 bool success(); | 79 bool success(); |
| 70 | 80 |
| 71 private: | 81 private: |
| 72 void CreateRootCallback(); | 82 void CreateRootCallback(); |
| 73 | 83 |
| 74 base::Closure callback_; | 84 base::Closure callback_; |
| 75 AbstractProfileSyncServiceTest* test_; | 85 BaseProfileSyncServiceTest* test_; |
| 76 syncer::ModelType model_type_; | 86 syncer::ModelType model_type_; |
| 77 bool success_; | 87 bool success_; |
| 78 }; | 88 }; |
| 79 | 89 |
| 80 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 90 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
| OLD | NEW |