Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: components/sync/engine_impl/syncer_unittest.cc

Issue 2494873003: [Sync] Allow sync start without sign-in if the local sync backend is on. (Closed)
Patch Set: Rebased on ToT. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_,
306 false);
306 307
307 syncable::ReadTransaction trans(FROM_HERE, directory()); 308 syncable::ReadTransaction trans(FROM_HERE, directory());
308 Directory::Metahandles children; 309 Directory::Metahandles children;
309 directory()->GetChildHandlesById(&trans, trans.root_id(), &children); 310 directory()->GetChildHandlesById(&trans, trans.root_id(), &children);
310 ASSERT_EQ(0u, children.size()); 311 ASSERT_EQ(0u, children.size());
311 root_id_ = TestIdFactory::root(); 312 root_id_ = TestIdFactory::root();
312 parent_id_ = ids_.MakeServer("parent id"); 313 parent_id_ = ids_.MakeServer("parent id");
313 child_id_ = ids_.MakeServer("child id"); 314 child_id_ = ids_.MakeServer("child id");
314 directory()->set_store_birthday(mock_server_->store_birthday()); 315 directory()->set_store_birthday(mock_server_->store_birthday());
315 mock_server_->SetKeystoreKey("encryption_key"); 316 mock_server_->SetKeystoreKey("encryption_key");
(...skipping 5609 matching lines...) Expand 10 before | Expand all | Expand 10 after
5925 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); 5926 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id);
5926 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); 5927 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count);
5927 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); 5928 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count);
5928 } else { 5929 } else {
5929 EXPECT_TRUE(final_monitor_records.empty()) 5930 EXPECT_TRUE(final_monitor_records.empty())
5930 << "Should not restore records after successful bookmark commit."; 5931 << "Should not restore records after successful bookmark commit.";
5931 } 5932 }
5932 } 5933 }
5933 5934
5934 } // namespace syncer 5935 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698