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

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: 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
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 MOCK_METHOD1(OnExperimentsChanged, 90 MOCK_METHOD1(OnExperimentsChanged,
91 void(const syncer::Experiments&)); 91 void(const syncer::Experiments&));
92 MOCK_METHOD1(OnActionableError, 92 MOCK_METHOD1(OnActionableError,
93 void(const syncer::SyncProtocolError& sync_error)); 93 void(const syncer::SyncProtocolError& sync_error));
94 MOCK_METHOD0(OnSyncConfigureRetry, void()); 94 MOCK_METHOD0(OnSyncConfigureRetry, void());
95 }; 95 };
96 96
97 class FakeSyncManagerFactory : public syncer::SyncManagerFactory { 97 class FakeSyncManagerFactory : public syncer::SyncManagerFactory {
98 public: 98 public:
99 explicit FakeSyncManagerFactory(FakeSyncManager** fake_manager) 99 explicit FakeSyncManagerFactory(FakeSyncManager** fake_manager)
100 : fake_manager_(fake_manager) { 100 : SyncManagerFactory(NORMAL),
101 fake_manager_(fake_manager) {
101 *fake_manager_ = NULL; 102 *fake_manager_ = NULL;
102 } 103 }
103 virtual ~FakeSyncManagerFactory() {} 104 virtual ~FakeSyncManagerFactory() {}
104 105
105 // SyncManagerFactory implementation. Called on the sync thread. 106 // SyncManagerFactory implementation. Called on the sync thread.
106 virtual scoped_ptr<SyncManager> CreateSyncManager( 107 virtual scoped_ptr<SyncManager> CreateSyncManager(
107 std::string name) OVERRIDE { 108 std::string name) OVERRIDE {
108 *fake_manager_ = new FakeSyncManager(initial_sync_ended_types_, 109 *fake_manager_ = new FakeSyncManager(initial_sync_ended_types_,
109 progress_marker_types_, 110 progress_marker_types_,
110 configure_fail_types_); 111 configure_fail_types_);
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 ASSERT_NE(-1, base::WriteFile(sync_file, nonsense, strlen(nonsense))); 710 ASSERT_NE(-1, base::WriteFile(sync_file, nonsense, strlen(nonsense)));
710 711
711 InitializeBackend(true); 712 InitializeBackend(true);
712 713
713 EXPECT_FALSE(base::PathExists(sync_file)); 714 EXPECT_FALSE(base::PathExists(sync_file));
714 } 715 }
715 716
716 } // namespace 717 } // namespace
717 718
718 } // namespace browser_sync 719 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_service.cc » ('j') | sync/internal_api/public/sync_manager_factory.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698