| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 debug_info_getter_.get(), model_type_registry_.get(), | 295 debug_info_getter_.get(), model_type_registry_.get(), |
| 296 true, // enable keystore encryption | 296 true, // enable keystore encryption |
| 297 false, // force enable pre-commit GU avoidance experiment | 297 false, // force enable pre-commit GU avoidance experiment |
| 298 "fake_invalidator_client_id"); | 298 "fake_invalidator_client_id"); |
| 299 context_->SetRoutingInfo(routing_info); | 299 context_->SetRoutingInfo(routing_info); |
| 300 syncer_ = new Syncer(&cancelation_signal_); | 300 syncer_ = new Syncer(&cancelation_signal_); |
| 301 scheduler_ = base::MakeUnique<SyncSchedulerImpl>( | 301 scheduler_ = base::MakeUnique<SyncSchedulerImpl>( |
| 302 "TestSyncScheduler", BackoffDelayProvider::FromDefaults(), | 302 "TestSyncScheduler", BackoffDelayProvider::FromDefaults(), |
| 303 context_.get(), | 303 context_.get(), |
| 304 // scheduler_ owned syncer_ now and will manage the memory of syncer_ | 304 // scheduler_ owned syncer_ now and will manage the memory of syncer_ |
| 305 syncer_); | 305 syncer_, false); |
| 306 | 306 |
| 307 syncable::ReadTransaction trans(FROM_HERE, directory()); | 307 syncable::ReadTransaction trans(FROM_HERE, directory()); |
| 308 Directory::Metahandles children; | 308 Directory::Metahandles children; |
| 309 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); | 309 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); |
| 310 ASSERT_EQ(0u, children.size()); | 310 ASSERT_EQ(0u, children.size()); |
| 311 root_id_ = TestIdFactory::root(); | 311 root_id_ = TestIdFactory::root(); |
| 312 parent_id_ = ids_.MakeServer("parent id"); | 312 parent_id_ = ids_.MakeServer("parent id"); |
| 313 child_id_ = ids_.MakeServer("child id"); | 313 child_id_ = ids_.MakeServer("child id"); |
| 314 directory()->set_store_birthday(mock_server_->store_birthday()); | 314 directory()->set_store_birthday(mock_server_->store_birthday()); |
| 315 mock_server_->SetKeystoreKey("encryption_key"); | 315 mock_server_->SetKeystoreKey("encryption_key"); |
| (...skipping 5609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5925 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); | 5925 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); |
| 5926 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); | 5926 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); |
| 5927 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); | 5927 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); |
| 5928 } else { | 5928 } else { |
| 5929 EXPECT_TRUE(final_monitor_records.empty()) | 5929 EXPECT_TRUE(final_monitor_records.empty()) |
| 5930 << "Should not restore records after successful bookmark commit."; | 5930 << "Should not restore records after successful bookmark commit."; |
| 5931 } | 5931 } |
| 5932 } | 5932 } |
| 5933 | 5933 |
| 5934 } // namespace syncer | 5934 } // namespace syncer |
| OLD | NEW |