| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/sync/engine_impl/syncer.h" | 5 #include "components/sync/engine_impl/syncer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 FAIL() << "Handling unknown error type in unit tests!!"; | 231 FAIL() << "Handling unknown error type in unit tests!!"; |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 void OnActionableError(const SyncProtocolError& error) override {} | 235 void OnActionableError(const SyncProtocolError& error) override {} |
| 236 void OnRetryTimeChanged(base::Time retry_time) override {} | 236 void OnRetryTimeChanged(base::Time retry_time) override {} |
| 237 void OnThrottledTypesChanged(ModelTypeSet throttled_types) override {} | 237 void OnThrottledTypesChanged(ModelTypeSet throttled_types) override {} |
| 238 void OnBackedOffTypesChanged(ModelTypeSet backed_off_types) override {} | 238 void OnBackedOffTypesChanged(ModelTypeSet backed_off_types) override {} |
| 239 void OnMigrationRequested(ModelTypeSet types) override {} | 239 void OnMigrationRequested(ModelTypeSet types) override {} |
| 240 | 240 |
| 241 void ResetCycle() { cycle_.reset(SyncCycle::Build(context_.get(), this)); } | 241 void ResetCycle() { |
| 242 cycle_ = base::MakeUnique<SyncCycle>(context_.get(), this); |
| 243 } |
| 242 | 244 |
| 243 bool SyncShareNudge() { | 245 bool SyncShareNudge() { |
| 244 ResetCycle(); | 246 ResetCycle(); |
| 245 | 247 |
| 246 // Pretend we've seen a local change, to make the nudge_tracker look normal. | 248 // Pretend we've seen a local change, to make the nudge_tracker look normal. |
| 247 nudge_tracker_.RecordLocalChange(ModelTypeSet(BOOKMARKS)); | 249 nudge_tracker_.RecordLocalChange(ModelTypeSet(BOOKMARKS)); |
| 248 | 250 |
| 249 return syncer_->NormalSyncShare(context_->GetEnabledTypes(), | 251 return syncer_->NormalSyncShare(context_->GetEnabledTypes(), |
| 250 &nudge_tracker_, cycle_.get()); | 252 &nudge_tracker_, cycle_.get()); |
| 251 } | 253 } |
| (...skipping 5655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5907 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); | 5909 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); |
| 5908 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); | 5910 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); |
| 5909 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); | 5911 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); |
| 5910 } else { | 5912 } else { |
| 5911 EXPECT_TRUE(final_monitor_records.empty()) | 5913 EXPECT_TRUE(final_monitor_records.empty()) |
| 5912 << "Should not restore records after successful bookmark commit."; | 5914 << "Should not restore records after successful bookmark commit."; |
| 5913 } | 5915 } |
| 5914 } | 5916 } |
| 5915 | 5917 |
| 5916 } // namespace syncer | 5918 } // namespace syncer |
| OLD | NEW |