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 #include "chrome/browser/sync/glue/sync_backend_host.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "base/test/test_timeouts.h" | 13 #include "base/test/test_timeouts.h" |
| 14 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 15 #include "chrome/browser/prefs/pref_service_syncable.h" |
14 #include "chrome/browser/sync/glue/device_info.h" | 16 #include "chrome/browser/sync/glue/device_info.h" |
15 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 17 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
16 #include "chrome/browser/sync/invalidations/invalidator_storage.h" | 18 #include "chrome/browser/sync/invalidations/invalidator_storage.h" |
17 #include "chrome/browser/sync/sync_prefs.h" | 19 #include "chrome/browser/sync/sync_prefs.h" |
18 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
19 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
20 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
21 #include "content/public/test/test_browser_thread.h" | 23 #include "content/public/test/test_browser_thread.h" |
22 #include "google/cacheinvalidation/include/types.h" | 24 #include "google/cacheinvalidation/include/types.h" |
23 #include "googleurl/src/gurl.h" | 25 #include "googleurl/src/gurl.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 io_thread_(BrowserThread::IO), | 139 io_thread_(BrowserThread::IO), |
138 fake_manager_(NULL) {} | 140 fake_manager_(NULL) {} |
139 | 141 |
140 virtual ~SyncBackendHostTest() {} | 142 virtual ~SyncBackendHostTest() {} |
141 | 143 |
142 virtual void SetUp() OVERRIDE { | 144 virtual void SetUp() OVERRIDE { |
143 io_thread_.StartIOThread(); | 145 io_thread_.StartIOThread(); |
144 profile_.reset(new TestingProfile()); | 146 profile_.reset(new TestingProfile()); |
145 profile_->CreateRequestContext(); | 147 profile_->CreateRequestContext(); |
146 sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs())); | 148 sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs())); |
147 invalidator_storage_.reset(new InvalidatorStorage(profile_->GetPrefs())); | 149 invalidator_storage_.reset(new InvalidatorStorage( |
| 150 profile_->GetPrefs(), |
| 151 static_cast<PrefRegistrySyncable*>( |
| 152 profile_->GetPrefs()->DeprecatedGetPrefRegistry()))); |
148 backend_.reset(new SyncBackendHost( | 153 backend_.reset(new SyncBackendHost( |
149 profile_->GetDebugName(), | 154 profile_->GetDebugName(), |
150 profile_.get(), | 155 profile_.get(), |
151 sync_prefs_->AsWeakPtr(), | 156 sync_prefs_->AsWeakPtr(), |
152 invalidator_storage_->AsWeakPtr())); | 157 invalidator_storage_->AsWeakPtr())); |
153 credentials_.email = "user@example.com"; | 158 credentials_.email = "user@example.com"; |
154 credentials_.sync_token = "sync_token"; | 159 credentials_.sync_token = "sync_token"; |
155 | 160 |
156 // These types are always implicitly enabled. | 161 // These types are always implicitly enabled. |
157 enabled_types_.PutAll(syncer::ControlTypes()); | 162 enabled_types_.PutAll(syncer::ControlTypes()); |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 fake_manager_->WaitForSyncThread(); | 746 fake_manager_->WaitForSyncThread(); |
742 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); | 747 EXPECT_FALSE(types.Equals(fake_manager_->GetLastRefreshRequestTypes())); |
743 | 748 |
744 backend_->Shutdown(false); | 749 backend_->Shutdown(false); |
745 backend_.reset(); | 750 backend_.reset(); |
746 } | 751 } |
747 | 752 |
748 } // namespace | 753 } // namespace |
749 | 754 |
750 } // namespace browser_sync | 755 } // namespace browser_sync |
OLD | NEW |