| 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 // | |
| 5 // Syncer unit tests. Unfortunately a lot of these tests | |
| 6 // are outdated and need to be reworked and updated. | |
| 7 | 4 |
| 8 #include "components/sync/engine_impl/syncer.h" | 5 #include "components/sync/engine_impl/syncer.h" |
| 9 | 6 |
| 10 #include <stddef.h> | 7 #include <stddef.h> |
| 11 | 8 |
| 12 #include <algorithm> | 9 #include <algorithm> |
| 13 #include <limits> | 10 #include <limits> |
| 14 #include <list> | 11 #include <list> |
| 15 #include <map> | 12 #include <map> |
| 16 #include <memory> | 13 #include <memory> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 165 } |
| 169 | 166 |
| 170 void TypeDebugInfoCache::OnStatusCountersUpdated( | 167 void TypeDebugInfoCache::OnStatusCountersUpdated( |
| 171 ModelType type, | 168 ModelType type, |
| 172 const StatusCounters& counters) { | 169 const StatusCounters& counters) { |
| 173 status_counters_map_[type] = counters; | 170 status_counters_map_[type] = counters; |
| 174 } | 171 } |
| 175 | 172 |
| 176 } // namespace | 173 } // namespace |
| 177 | 174 |
| 175 // Syncer unit tests. Unfortunately a lot of these tests |
| 176 // are outdated and need to be reworked and updated. |
| 178 class SyncerTest : public testing::Test, | 177 class SyncerTest : public testing::Test, |
| 179 public SyncCycle::Delegate, | 178 public SyncCycle::Delegate, |
| 180 public SyncEngineEventListener { | 179 public SyncEngineEventListener { |
| 181 protected: | 180 protected: |
| 182 SyncerTest() | 181 SyncerTest() |
| 183 : extensions_activity_(new ExtensionsActivity), | 182 : extensions_activity_(new ExtensionsActivity), |
| 184 syncer_(nullptr), | 183 syncer_(nullptr), |
| 185 last_client_invalidation_hint_buffer_size_(10) {} | 184 last_client_invalidation_hint_buffer_size_(10) {} |
| 186 | 185 |
| 187 // SyncCycle::Delegate implementation. | 186 // SyncCycle::Delegate implementation. |
| (...skipping 5652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5840 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); | 5839 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); |
| 5841 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); | 5840 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); |
| 5842 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); | 5841 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); |
| 5843 } else { | 5842 } else { |
| 5844 EXPECT_TRUE(final_monitor_records.empty()) | 5843 EXPECT_TRUE(final_monitor_records.empty()) |
| 5845 << "Should not restore records after successful bookmark commit."; | 5844 << "Should not restore records after successful bookmark commit."; |
| 5846 } | 5845 } |
| 5847 } | 5846 } |
| 5848 | 5847 |
| 5849 } // namespace syncer | 5848 } // namespace syncer |
| OLD | NEW |