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_impl.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/message_loop.h" | 11 #include "base/message_loop/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/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
15 #include "chrome/browser/invalidation/invalidator_storage.h" | 15 #include "chrome/browser/invalidation/invalidator_storage.h" |
16 #include "chrome/browser/prefs/pref_service_syncable.h" | 16 #include "chrome/browser/prefs/pref_service_syncable.h" |
17 #include "chrome/browser/sync/glue/device_info.h" | 17 #include "chrome/browser/sync/glue/device_info.h" |
| 18 #include "chrome/browser/sync/glue/sync_frontend.h" |
18 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 19 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
19 #include "chrome/browser/sync/sync_prefs.h" | 20 #include "chrome/browser/sync/sync_prefs.h" |
20 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
21 #include "components/user_prefs/pref_registry_syncable.h" | 22 #include "components/user_prefs/pref_registry_syncable.h" |
22 #include "content/public/browser/notification_service.h" | 23 #include "content/public/browser/notification_service.h" |
23 #include "content/public/test/test_browser_thread_bundle.h" | 24 #include "content/public/test/test_browser_thread_bundle.h" |
24 #include "content/public/test/test_utils.h" | 25 #include "content/public/test/test_utils.h" |
25 #include "google/cacheinvalidation/include/types.h" | 26 #include "google/cacheinvalidation/include/types.h" |
26 #include "net/url_request/test_url_fetcher_factory.h" | 27 #include "net/url_request/test_url_fetcher_factory.h" |
27 #include "sync/internal_api/public/base/model_type.h" | 28 #include "sync/internal_api/public/base/model_type.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 protected: | 131 protected: |
131 SyncBackendHostTest() | 132 SyncBackendHostTest() |
132 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD), | 133 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD), |
133 fake_manager_(NULL) {} | 134 fake_manager_(NULL) {} |
134 | 135 |
135 virtual ~SyncBackendHostTest() {} | 136 virtual ~SyncBackendHostTest() {} |
136 | 137 |
137 virtual void SetUp() OVERRIDE { | 138 virtual void SetUp() OVERRIDE { |
138 profile_.reset(new TestingProfile()); | 139 profile_.reset(new TestingProfile()); |
139 sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs())); | 140 sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs())); |
140 backend_.reset(new SyncBackendHost( | 141 backend_.reset(new SyncBackendHostImpl( |
141 profile_->GetDebugName(), | 142 profile_->GetDebugName(), |
142 profile_.get(), | 143 profile_.get(), |
143 sync_prefs_->AsWeakPtr())); | 144 sync_prefs_->AsWeakPtr())); |
144 credentials_.email = "user@example.com"; | 145 credentials_.email = "user@example.com"; |
145 credentials_.sync_token = "sync_token"; | 146 credentials_.sync_token = "sync_token"; |
146 | 147 |
147 fake_manager_factory_.reset(new FakeSyncManagerFactory(&fake_manager_)); | 148 fake_manager_factory_.reset(new FakeSyncManagerFactory(&fake_manager_)); |
148 | 149 |
149 // These types are always implicitly enabled. | 150 // These types are always implicitly enabled. |
150 enabled_types_.PutAll(syncer::ControlTypes()); | 151 enabled_types_.PutAll(syncer::ControlTypes()); |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 fake_manager_factory_->set_progress_marker_types(enabled_types_); | 683 fake_manager_factory_->set_progress_marker_types(enabled_types_); |
683 fake_manager_factory_->set_initial_sync_ended_types(enabled_types_); | 684 fake_manager_factory_->set_initial_sync_ended_types(enabled_types_); |
684 InitializeBackend(true); | 685 InitializeBackend(true); |
685 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, | 686 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, |
686 fake_manager_->GetAndResetConfigureReason()); | 687 fake_manager_->GetAndResetConfigureReason()); |
687 } | 688 } |
688 | 689 |
689 } // namespace | 690 } // namespace |
690 | 691 |
691 } // namespace browser_sync | 692 } // namespace browser_sync |
OLD | NEW |