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

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: Remove ifdefs around include. Created 4 years 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_, 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
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
OLDNEW
« no previous file with comments | « components/sync/engine_impl/sync_scheduler_impl_unittest.cc ('k') | components/sync/test/engine/mock_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698