| 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 // Syncer unit tests. Unfortunately a lot of these tests | 5 // Syncer unit tests. Unfortunately a lot of these tests |
| 6 // are outdated and need to be reworked and updated. | 6 // are outdated and need to be reworked and updated. |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 GetModelSafeRoutingInfo(&routing_info); | 233 GetModelSafeRoutingInfo(&routing_info); |
| 234 GetWorkers(&workers); | 234 GetWorkers(&workers); |
| 235 | 235 |
| 236 context_.reset( | 236 context_.reset( |
| 237 new SyncSessionContext( | 237 new SyncSessionContext( |
| 238 mock_server_.get(), directory(), workers, | 238 mock_server_.get(), directory(), workers, |
| 239 &extensions_activity_monitor_, | 239 &extensions_activity_monitor_, |
| 240 listeners, NULL, &traffic_recorder_, | 240 listeners, NULL, &traffic_recorder_, |
| 241 true, // enable keystore encryption | 241 true, // enable keystore encryption |
| 242 false, // force enable pre-commit GU avoidance experiment |
| 242 "fake_invalidator_client_id")); | 243 "fake_invalidator_client_id")); |
| 243 context_->set_routing_info(routing_info); | 244 context_->set_routing_info(routing_info); |
| 244 syncer_ = new Syncer(); | 245 syncer_ = new Syncer(); |
| 245 | 246 |
| 246 syncable::ReadTransaction trans(FROM_HERE, directory()); | 247 syncable::ReadTransaction trans(FROM_HERE, directory()); |
| 247 syncable::Directory::Metahandles children; | 248 syncable::Directory::Metahandles children; |
| 248 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); | 249 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); |
| 249 ASSERT_EQ(0u, children.size()); | 250 ASSERT_EQ(0u, children.size()); |
| 250 saw_syncer_event_ = false; | 251 saw_syncer_event_ = false; |
| 251 root_id_ = TestIdFactory::root(); | 252 root_id_ = TestIdFactory::root(); |
| (...skipping 4566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4818 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); | 4819 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); |
| 4819 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); | 4820 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); |
| 4820 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); | 4821 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); |
| 4821 } else { | 4822 } else { |
| 4822 EXPECT_TRUE(final_monitor_records.empty()) | 4823 EXPECT_TRUE(final_monitor_records.empty()) |
| 4823 << "Should not restore records after successful bookmark commit."; | 4824 << "Should not restore records after successful bookmark commit."; |
| 4824 } | 4825 } |
| 4825 } | 4826 } |
| 4826 | 4827 |
| 4827 } // namespace syncer | 4828 } // namespace syncer |
| OLD | NEW |