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

Side by Side Diff: components/browser_sync/profile_sync_service_unittest.cc

Issue 2689773002: [Sync] Replace typedef with using. (Closed)
Patch Set: [Sync] Replace typedef with using. Created 3 years, 10 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
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 "components/browser_sync/profile_sync_service.h" 5 #include "components/browser_sync/profile_sync_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 namespace browser_sync { 48 namespace browser_sync {
49 49
50 namespace { 50 namespace {
51 51
52 const char kGaiaId[] = "12345"; 52 const char kGaiaId[] = "12345";
53 const char kEmail[] = "test_user@gmail.com"; 53 const char kEmail[] = "test_user@gmail.com";
54 54
55 class FakeDataTypeManager : public syncer::DataTypeManager { 55 class FakeDataTypeManager : public syncer::DataTypeManager {
56 public: 56 public:
57 typedef base::Callback<void(syncer::ConfigureReason)> ConfigureCalled; 57 using ConfigureCalled = base::Callback<void(syncer::ConfigureReason)>;
58 58
59 explicit FakeDataTypeManager(const ConfigureCalled& configure_called) 59 explicit FakeDataTypeManager(const ConfigureCalled& configure_called)
60 : configure_called_(configure_called) {} 60 : configure_called_(configure_called) {}
61 61
62 ~FakeDataTypeManager() override{}; 62 ~FakeDataTypeManager() override{};
63 63
64 void Configure(syncer::ModelTypeSet desired_types, 64 void Configure(syncer::ModelTypeSet desired_types,
65 syncer::ConfigureReason reason) override { 65 syncer::ConfigureReason reason) override {
66 DCHECK(!configure_called_.is_null()); 66 DCHECK(!configure_called_.is_null());
67 configure_called_.Run(reason); 67 configure_called_.Run(reason);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 private: 123 private:
124 std::vector<bool>* delete_dir_param_; 124 std::vector<bool>* delete_dir_param_;
125 }; 125 };
126 126
127 // FakeSyncEngine that calls an external callback when ClearServerData is 127 // FakeSyncEngine that calls an external callback when ClearServerData is
128 // called. 128 // called.
129 class SyncEngineCaptureClearServerData : public FakeSyncEngine { 129 class SyncEngineCaptureClearServerData : public FakeSyncEngine {
130 public: 130 public:
131 typedef base::Callback<void( 131 using ClearServerDataCalled =
132 const syncer::SyncManager::ClearServerDataCallback&)> 132 base::Callback<void(const syncer::SyncManager::ClearServerDataCallback&)>;
133 ClearServerDataCalled;
134 explicit SyncEngineCaptureClearServerData( 133 explicit SyncEngineCaptureClearServerData(
135 const ClearServerDataCalled& clear_server_data_called) 134 const ClearServerDataCalled& clear_server_data_called)
136 : clear_server_data_called_(clear_server_data_called) {} 135 : clear_server_data_called_(clear_server_data_called) {}
137 136
138 void ClearServerData( 137 void ClearServerData(
139 const syncer::SyncManager::ClearServerDataCallback& callback) override { 138 const syncer::SyncManager::ClearServerDataCallback& callback) override {
140 clear_server_data_called_.Run(callback); 139 clear_server_data_called_.Run(callback);
141 } 140 }
142 141
143 private: 142 private:
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 // Progress the controller to RUNNING first, which is how the service 968 // Progress the controller to RUNNING first, which is how the service
970 // determines whether a type is enabled. 969 // determines whether a type is enabled.
971 controller->StartAssociating(base::Bind(&DoNothing)); 970 controller->StartAssociating(base::Bind(&DoNothing));
972 controller->FinishStart(DataTypeController::OK_FIRST_RUN); 971 controller->FinishStart(DataTypeController::OK_FIRST_RUN);
973 service()->RegisterDataTypeController(std::move(controller)); 972 service()->RegisterDataTypeController(std::move(controller));
974 EXPECT_NE(nullptr, service()->GetOpenTabsUIDelegate()); 973 EXPECT_NE(nullptr, service()->GetOpenTabsUIDelegate());
975 } 974 }
976 975
977 } // namespace 976 } // namespace
978 } // namespace browser_sync 977 } // namespace browser_sync
OLDNEW
« no previous file with comments | « components/browser_sync/profile_sync_service_bookmark_unittest.cc ('k') | components/browser_sync/profile_sync_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698