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

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

Issue 265823009: Let SyncManagerFactory create different types of sync managers according to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot Created 6 years, 7 months 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
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_impl.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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 MOCK_METHOD1(OnExperimentsChanged, 102 MOCK_METHOD1(OnExperimentsChanged,
103 void(const syncer::Experiments&)); 103 void(const syncer::Experiments&));
104 MOCK_METHOD1(OnActionableError, 104 MOCK_METHOD1(OnActionableError,
105 void(const syncer::SyncProtocolError& sync_error)); 105 void(const syncer::SyncProtocolError& sync_error));
106 MOCK_METHOD0(OnSyncConfigureRetry, void()); 106 MOCK_METHOD0(OnSyncConfigureRetry, void());
107 }; 107 };
108 108
109 class FakeSyncManagerFactory : public syncer::SyncManagerFactory { 109 class FakeSyncManagerFactory : public syncer::SyncManagerFactory {
110 public: 110 public:
111 explicit FakeSyncManagerFactory(FakeSyncManager** fake_manager) 111 explicit FakeSyncManagerFactory(FakeSyncManager** fake_manager)
112 : fake_manager_(fake_manager) { 112 : SyncManagerFactory(NORMAL),
113 fake_manager_(fake_manager) {
113 *fake_manager_ = NULL; 114 *fake_manager_ = NULL;
114 } 115 }
115 virtual ~FakeSyncManagerFactory() {} 116 virtual ~FakeSyncManagerFactory() {}
116 117
117 // SyncManagerFactory implementation. Called on the sync thread. 118 // SyncManagerFactory implementation. Called on the sync thread.
118 virtual scoped_ptr<SyncManager> CreateSyncManager( 119 virtual scoped_ptr<SyncManager> CreateSyncManager(
119 std::string name) OVERRIDE { 120 std::string name) OVERRIDE {
120 *fake_manager_ = new FakeSyncManager(initial_sync_ended_types_, 121 *fake_manager_ = new FakeSyncManager(initial_sync_ended_types_,
121 progress_marker_types_, 122 progress_marker_types_,
122 configure_fail_types_); 123 configure_fail_types_);
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 ASSERT_NE(-1, base::WriteFile(sync_file, nonsense, strlen(nonsense))); 723 ASSERT_NE(-1, base::WriteFile(sync_file, nonsense, strlen(nonsense)));
723 724
724 InitializeBackend(true); 725 InitializeBackend(true);
725 726
726 EXPECT_FALSE(base::PathExists(sync_file)); 727 EXPECT_FALSE(base::PathExists(sync_file));
727 } 728 }
728 729
729 } // namespace 730 } // namespace
730 731
731 } // namespace browser_sync 732 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698