Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(717)

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_unittest.cc

Issue 61183003: Refactor SyncBackendHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove double virtual Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
6
7 #include <cstddef> 5 #include <cstddef>
8 6
9 #include "base/location.h" 7 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
12 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
13 #include "base/test/test_timeouts.h" 11 #include "base/test/test_timeouts.h"
14 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
15 #include "chrome/browser/invalidation/invalidator_storage.h" 13 #include "chrome/browser/invalidation/invalidator_storage.h"
16 #include "chrome/browser/prefs/pref_service_syncable.h" 14 #include "chrome/browser/prefs/pref_service_syncable.h"
17 #include "chrome/browser/sync/glue/device_info.h" 15 #include "chrome/browser/sync/glue/device_info.h"
16 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
Nicolas Zea 2013/11/06 18:03:21 nit: move to be first #include?
rlarocque 2013/11/06 21:48:47 The style checker complains. I think it has an ex
Nicolas Zea 2013/11/06 22:18:25 Ah, yeah, I'd prefer renaming to match the impl
rlarocque 2013/11/06 22:48:47 Done.
17 #include "chrome/browser/sync/glue/sync_frontend.h"
18 #include "chrome/browser/sync/glue/synced_device_tracker.h" 18 #include "chrome/browser/sync/glue/synced_device_tracker.h"
19 #include "chrome/browser/sync/sync_prefs.h" 19 #include "chrome/browser/sync/sync_prefs.h"
20 #include "chrome/test/base/testing_profile.h" 20 #include "chrome/test/base/testing_profile.h"
21 #include "components/user_prefs/pref_registry_syncable.h" 21 #include "components/user_prefs/pref_registry_syncable.h"
22 #include "content/public/browser/notification_service.h" 22 #include "content/public/browser/notification_service.h"
23 #include "content/public/test/test_browser_thread_bundle.h" 23 #include "content/public/test/test_browser_thread_bundle.h"
24 #include "content/public/test/test_utils.h" 24 #include "content/public/test/test_utils.h"
25 #include "google/cacheinvalidation/include/types.h" 25 #include "google/cacheinvalidation/include/types.h"
26 #include "net/url_request/test_url_fetcher_factory.h" 26 #include "net/url_request/test_url_fetcher_factory.h"
27 #include "sync/internal_api/public/base/model_type.h" 27 #include "sync/internal_api/public/base/model_type.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 protected: 130 protected:
131 SyncBackendHostTest() 131 SyncBackendHostTest()
132 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD), 132 : thread_bundle_(content::TestBrowserThreadBundle::REAL_IO_THREAD),
133 fake_manager_(NULL) {} 133 fake_manager_(NULL) {}
134 134
135 virtual ~SyncBackendHostTest() {} 135 virtual ~SyncBackendHostTest() {}
136 136
137 virtual void SetUp() OVERRIDE { 137 virtual void SetUp() OVERRIDE {
138 profile_.reset(new TestingProfile()); 138 profile_.reset(new TestingProfile());
139 sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs())); 139 sync_prefs_.reset(new SyncPrefs(profile_->GetPrefs()));
140 backend_.reset(new SyncBackendHost( 140 backend_.reset(new SyncBackendHostImpl(
141 profile_->GetDebugName(), 141 profile_->GetDebugName(),
142 profile_.get(), 142 profile_.get(),
143 sync_prefs_->AsWeakPtr())); 143 sync_prefs_->AsWeakPtr()));
144 credentials_.email = "user@example.com"; 144 credentials_.email = "user@example.com";
145 credentials_.sync_token = "sync_token"; 145 credentials_.sync_token = "sync_token";
146 146
147 fake_manager_factory_.reset(new FakeSyncManagerFactory(&fake_manager_)); 147 fake_manager_factory_.reset(new FakeSyncManagerFactory(&fake_manager_));
148 148
149 // These types are always implicitly enabled. 149 // These types are always implicitly enabled.
150 enabled_types_.PutAll(syncer::ControlTypes()); 150 enabled_types_.PutAll(syncer::ControlTypes());
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 fake_manager_factory_->set_progress_marker_types(enabled_types_); 682 fake_manager_factory_->set_progress_marker_types(enabled_types_);
683 fake_manager_factory_->set_initial_sync_ended_types(enabled_types_); 683 fake_manager_factory_->set_initial_sync_ended_types(enabled_types_);
684 InitializeBackend(true); 684 InitializeBackend(true);
685 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, 685 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE,
686 fake_manager_->GetAndResetConfigureReason()); 686 fake_manager_->GetAndResetConfigureReason());
687 } 687 }
688 688
689 } // namespace 689 } // namespace
690 690
691 } // namespace browser_sync 691 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698