| 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_bundle.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 struct UserShare; | 25 struct UserShare; |
| 26 } // namespace syncer | 26 } // namespace syncer |
| (...skipping 18 matching lines...) Expand all Loading... |
| 45 virtual void SetUp() OVERRIDE; | 45 virtual void SetUp() OVERRIDE; |
| 46 | 46 |
| 47 virtual void TearDown() OVERRIDE; | 47 virtual void TearDown() OVERRIDE; |
| 48 | 48 |
| 49 bool CreateRoot(syncer::ModelType model_type); | 49 bool CreateRoot(syncer::ModelType model_type); |
| 50 | 50 |
| 51 static BrowserContextKeyedService* BuildTokenService( | 51 static BrowserContextKeyedService* BuildTokenService( |
| 52 content::BrowserContext* profile); | 52 content::BrowserContext* profile); |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 base::MessageLoopForUI ui_loop_; | 55 content::TestBrowserThreadBundle thread_bundle_; |
| 56 content::TestBrowserThread ui_thread_; | |
| 57 content::TestBrowserThread db_thread_; | |
| 58 content::TestBrowserThread file_thread_; | |
| 59 content::TestBrowserThread io_thread_; | |
| 60 TokenService* token_service_; | 56 TokenService* token_service_; |
| 61 TestProfileSyncService* sync_service_; | 57 TestProfileSyncService* sync_service_; |
| 62 }; | 58 }; |
| 63 | 59 |
| 64 class CreateRootHelper { | 60 class CreateRootHelper { |
| 65 public: | 61 public: |
| 66 CreateRootHelper(AbstractProfileSyncServiceTest* test, | 62 CreateRootHelper(AbstractProfileSyncServiceTest* test, |
| 67 syncer::ModelType model_type); | 63 syncer::ModelType model_type); |
| 68 virtual ~CreateRootHelper(); | 64 virtual ~CreateRootHelper(); |
| 69 | 65 |
| 70 const base::Closure& callback() const; | 66 const base::Closure& callback() const; |
| 71 bool success(); | 67 bool success(); |
| 72 | 68 |
| 73 private: | 69 private: |
| 74 void CreateRootCallback(); | 70 void CreateRootCallback(); |
| 75 | 71 |
| 76 base::Closure callback_; | 72 base::Closure callback_; |
| 77 AbstractProfileSyncServiceTest* test_; | 73 AbstractProfileSyncServiceTest* test_; |
| 78 syncer::ModelType model_type_; | 74 syncer::ModelType model_type_; |
| 79 bool success_; | 75 bool success_; |
| 80 }; | 76 }; |
| 81 | 77 |
| 82 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 78 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
| OLD | NEW |