OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
13 #include "base/task.h" | 14 #include "base/task.h" |
14 #include "chrome/browser/net/gaia/token_service.h" | 15 #include "chrome/browser/net/gaia/token_service.h" |
15 #include "chrome/browser/sync/internal_api/change_record.h" | 16 #include "chrome/browser/sync/internal_api/change_record.h" |
16 #include "chrome/browser/sync/profile_sync_factory_mock.h" | 17 #include "chrome/browser/sync/profile_sync_factory_mock.h" |
17 #include "chrome/browser/sync/syncable/model_type.h" | 18 #include "chrome/browser/sync/syncable/model_type.h" |
18 #include "content/test/test_browser_thread.h" | 19 #include "content/test/test_browser_thread.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 | 21 |
(...skipping 24 matching lines...) Expand all Loading... |
45 MakeSingletonDeletionChangeRecordList( | 46 MakeSingletonDeletionChangeRecordList( |
46 int64 node_id, | 47 int64 node_id, |
47 const sync_pb::EntitySpecifics& specifics); | 48 const sync_pb::EntitySpecifics& specifics); |
48 }; | 49 }; |
49 | 50 |
50 class AbstractProfileSyncServiceTest : public testing::Test { | 51 class AbstractProfileSyncServiceTest : public testing::Test { |
51 public: | 52 public: |
52 AbstractProfileSyncServiceTest(); | 53 AbstractProfileSyncServiceTest(); |
53 virtual ~AbstractProfileSyncServiceTest(); | 54 virtual ~AbstractProfileSyncServiceTest(); |
54 | 55 |
55 virtual void SetUp(); | 56 virtual void SetUp() OVERRIDE; |
56 | 57 |
57 virtual void TearDown(); | 58 virtual void TearDown() OVERRIDE; |
58 | 59 |
59 bool CreateRoot(syncable::ModelType model_type); | 60 bool CreateRoot(syncable::ModelType model_type); |
60 | 61 |
61 protected: | 62 protected: |
62 MessageLoopForUI ui_loop_; | 63 MessageLoopForUI ui_loop_; |
63 content::TestBrowserThread ui_thread_; | 64 content::TestBrowserThread ui_thread_; |
64 content::TestBrowserThread db_thread_; | 65 content::TestBrowserThread db_thread_; |
65 content::TestBrowserThread io_thread_; | 66 content::TestBrowserThread io_thread_; |
66 ProfileSyncFactoryMock factory_; | 67 ProfileSyncFactoryMock factory_; |
67 scoped_ptr<TokenService> token_service_; | 68 scoped_ptr<TokenService> token_service_; |
68 scoped_ptr<TestProfileSyncService> service_; | 69 scoped_ptr<TestProfileSyncService> service_; |
69 }; | 70 }; |
70 | 71 |
71 class CreateRootTask : public Task { | 72 class CreateRootTask : public Task { |
72 public: | 73 public: |
73 CreateRootTask(AbstractProfileSyncServiceTest* test, | 74 CreateRootTask(AbstractProfileSyncServiceTest* test, |
74 syncable::ModelType model_type); | 75 syncable::ModelType model_type); |
75 | 76 |
76 virtual ~CreateRootTask(); | 77 virtual ~CreateRootTask(); |
77 virtual void Run(); | 78 virtual void Run() OVERRIDE; |
78 | 79 |
79 bool success(); | 80 bool success(); |
80 | 81 |
81 private: | 82 private: |
82 AbstractProfileSyncServiceTest* test_; | 83 AbstractProfileSyncServiceTest* test_; |
83 syncable::ModelType model_type_; | 84 syncable::ModelType model_type_; |
84 bool success_; | 85 bool success_; |
85 }; | 86 }; |
86 | 87 |
87 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ | 88 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_ |
OLD | NEW |