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/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "chrome/browser/signin/token_service.h" | |
15 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 14 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
16 #include "content/public/test/test_browser_thread_bundle.h" | 15 #include "content/public/test/test_browser_thread_bundle.h" |
17 #include "sync/internal_api/public/base/model_type.h" | 16 #include "sync/internal_api/public/base/model_type.h" |
18 #include "sync/internal_api/public/change_record.h" | 17 #include "sync/internal_api/public/change_record.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
20 | 19 |
21 class ProfileSyncService; | 20 class ProfileSyncService; |
22 class TestProfileSyncService; | 21 class TestProfileSyncService; |
23 | 22 |
24 namespace syncer { | 23 namespace syncer { |
(...skipping 16 matching lines...) Expand all Loading... |
41 public: | 40 public: |
42 AbstractProfileSyncServiceTest(); | 41 AbstractProfileSyncServiceTest(); |
43 virtual ~AbstractProfileSyncServiceTest(); | 42 virtual ~AbstractProfileSyncServiceTest(); |
44 | 43 |
45 virtual void SetUp() OVERRIDE; | 44 virtual void SetUp() OVERRIDE; |
46 | 45 |
47 virtual void TearDown() OVERRIDE; | 46 virtual void TearDown() OVERRIDE; |
48 | 47 |
49 bool CreateRoot(syncer::ModelType model_type); | 48 bool CreateRoot(syncer::ModelType model_type); |
50 | 49 |
51 static BrowserContextKeyedService* BuildTokenService( | |
52 content::BrowserContext* profile); | |
53 | |
54 protected: | 50 protected: |
55 content::TestBrowserThreadBundle thread_bundle_; | 51 content::TestBrowserThreadBundle thread_bundle_; |
56 TokenService* token_service_; | |
57 TestProfileSyncService* sync_service_; | 52 TestProfileSyncService* sync_service_; |
58 }; | 53 }; |
59 | 54 |
60 class CreateRootHelper { | 55 class CreateRootHelper { |
61 public: | 56 public: |
62 CreateRootHelper(AbstractProfileSyncServiceTest* test, | 57 CreateRootHelper(AbstractProfileSyncServiceTest* test, |
63 syncer::ModelType model_type); | 58 syncer::ModelType model_type); |
64 virtual ~CreateRootHelper(); | 59 virtual ~CreateRootHelper(); |
65 | 60 |
66 const base::Closure& callback() const; | 61 const base::Closure& callback() const; |
67 bool success(); | 62 bool success(); |
68 | 63 |
69 private: | 64 private: |
70 void CreateRootCallback(); | 65 void CreateRootCallback(); |
71 | 66 |
72 base::Closure callback_; | 67 base::Closure callback_; |
73 AbstractProfileSyncServiceTest* test_; | 68 AbstractProfileSyncServiceTest* test_; |
74 syncer::ModelType model_type_; | 69 syncer::ModelType model_type_; |
75 bool success_; | 70 bool success_; |
76 }; | 71 }; |
77 | 72 |
78 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 73 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
OLD | NEW |