| 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/test/integration/sync_test.h" | 5 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 bool IsExitConditionSatisfied() override { | 170 bool IsExitConditionSatisfied() override { |
| 171 return IsEncryptionComplete(service()); | 171 return IsEncryptionComplete(service()); |
| 172 } | 172 } |
| 173 | 173 |
| 174 std::string GetDebugMessage() const override { return "Encryption"; } | 174 std::string GetDebugMessage() const override { return "Encryption"; } |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 std::unique_ptr<KeyedService> BuildFakeServerProfileInvalidationProvider( | 177 std::unique_ptr<KeyedService> BuildFakeServerProfileInvalidationProvider( |
| 178 content::BrowserContext* context) { | 178 content::BrowserContext* context) { |
| 179 return base::WrapUnique(new invalidation::ProfileInvalidationProvider( | 179 return base::MakeUnique<invalidation::ProfileInvalidationProvider>( |
| 180 std::unique_ptr<invalidation::InvalidationService>( | 180 std::unique_ptr<invalidation::InvalidationService>( |
| 181 new fake_server::FakeServerInvalidationService))); | 181 new fake_server::FakeServerInvalidationService)); |
| 182 } | 182 } |
| 183 | 183 |
| 184 std::unique_ptr<KeyedService> BuildP2PProfileInvalidationProvider( | 184 std::unique_ptr<KeyedService> BuildP2PProfileInvalidationProvider( |
| 185 content::BrowserContext* context, | 185 content::BrowserContext* context, |
| 186 syncer::P2PNotificationTarget notification_target) { | 186 syncer::P2PNotificationTarget notification_target) { |
| 187 Profile* profile = static_cast<Profile*>(context); | 187 Profile* profile = static_cast<Profile*>(context); |
| 188 return base::WrapUnique(new invalidation::ProfileInvalidationProvider( | 188 return base::MakeUnique<invalidation::ProfileInvalidationProvider>( |
| 189 std::unique_ptr<invalidation::InvalidationService>( | 189 std::unique_ptr<invalidation::InvalidationService>( |
| 190 new invalidation::P2PInvalidationService( | 190 new invalidation::P2PInvalidationService( |
| 191 std::unique_ptr<IdentityProvider>(new ProfileIdentityProvider( | 191 std::unique_ptr<IdentityProvider>(new ProfileIdentityProvider( |
| 192 SigninManagerFactory::GetForProfile(profile), | 192 SigninManagerFactory::GetForProfile(profile), |
| 193 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 193 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
| 194 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile( | 194 LoginUIServiceFactory::GetShowLoginPopupCallbackForProfile( |
| 195 profile))), | 195 profile))), |
| 196 profile->GetRequestContext(), notification_target)))); | 196 profile->GetRequestContext(), notification_target))); |
| 197 } | 197 } |
| 198 | 198 |
| 199 std::unique_ptr<KeyedService> BuildSelfNotifyingP2PProfileInvalidationProvider( | 199 std::unique_ptr<KeyedService> BuildSelfNotifyingP2PProfileInvalidationProvider( |
| 200 content::BrowserContext* context) { | 200 content::BrowserContext* context) { |
| 201 return BuildP2PProfileInvalidationProvider(context, syncer::NOTIFY_ALL); | 201 return BuildP2PProfileInvalidationProvider(context, syncer::NOTIFY_ALL); |
| 202 } | 202 } |
| 203 | 203 |
| 204 std::unique_ptr<KeyedService> BuildRealisticP2PProfileInvalidationProvider( | 204 std::unique_ptr<KeyedService> BuildRealisticP2PProfileInvalidationProvider( |
| 205 content::BrowserContext* context) { | 205 content::BrowserContext* context) { |
| 206 return BuildP2PProfileInvalidationProvider(context, syncer::NOTIFY_OTHERS); | 206 return BuildP2PProfileInvalidationProvider(context, syncer::NOTIFY_OTHERS); |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 | 1131 |
| 1132 void SyncTest::TriggerSyncForModelTypes(int index, | 1132 void SyncTest::TriggerSyncForModelTypes(int index, |
| 1133 syncer::ModelTypeSet model_types) { | 1133 syncer::ModelTypeSet model_types) { |
| 1134 GetSyncService(index)->TriggerRefresh(model_types); | 1134 GetSyncService(index)->TriggerRefresh(model_types); |
| 1135 } | 1135 } |
| 1136 | 1136 |
| 1137 void SyncTest::SetPreexistingPreferencesFileContents( | 1137 void SyncTest::SetPreexistingPreferencesFileContents( |
| 1138 const std::string& contents) { | 1138 const std::string& contents) { |
| 1139 preexisting_preferences_file_contents_ = contents; | 1139 preexisting_preferences_file_contents_ = contents; |
| 1140 } | 1140 } |
| OLD | NEW |