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

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

Issue 2256733004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/directory_update_handler.h" 5 #include "components/sync/engine_impl/directory_update_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 bookmarks_emitter_(BOOKMARKS, &type_observers_), 477 bookmarks_emitter_(BOOKMARKS, &type_observers_),
478 passwords_emitter_(PASSWORDS, &type_observers_), 478 passwords_emitter_(PASSWORDS, &type_observers_),
479 articles_emitter_(ARTICLES, &type_observers_) {} 479 articles_emitter_(ARTICLES, &type_observers_) {}
480 480
481 void SetUp() override { 481 void SetUp() override {
482 dir_maker_.SetUp(); 482 dir_maker_.SetUp();
483 entry_factory_.reset(new TestEntryFactory(directory())); 483 entry_factory_.reset(new TestEntryFactory(directory()));
484 484
485 update_handler_map_.insert(std::make_pair( 485 update_handler_map_.insert(std::make_pair(
486 BOOKMARKS, 486 BOOKMARKS,
487 base::WrapUnique(new DirectoryUpdateHandler( 487 base::MakeUnique<DirectoryUpdateHandler>(
488 directory(), BOOKMARKS, ui_worker_, &bookmarks_emitter_)))); 488 directory(), BOOKMARKS, ui_worker_, &bookmarks_emitter_)));
489 update_handler_map_.insert(std::make_pair( 489 update_handler_map_.insert(std::make_pair(
490 PASSWORDS, 490 PASSWORDS,
491 base::WrapUnique(new DirectoryUpdateHandler( 491 base::MakeUnique<DirectoryUpdateHandler>(
492 directory(), PASSWORDS, password_worker_, &passwords_emitter_)))); 492 directory(), PASSWORDS, password_worker_, &passwords_emitter_)));
493 update_handler_map_.insert(std::make_pair( 493 update_handler_map_.insert(std::make_pair(
494 ARTICLES, base::WrapUnique(new DirectoryUpdateHandler( 494 ARTICLES, base::MakeUnique<DirectoryUpdateHandler>(
495 directory(), ARTICLES, ui_worker_, &articles_emitter_)))); 495 directory(), ARTICLES, ui_worker_, &articles_emitter_)));
496 } 496 }
497 497
498 void TearDown() override { dir_maker_.TearDown(); } 498 void TearDown() override { dir_maker_.TearDown(); }
499 499
500 const UpdateCounters& GetBookmarksUpdateCounters() { 500 const UpdateCounters& GetBookmarksUpdateCounters() {
501 return bookmarks_emitter_.GetUpdateCounters(); 501 return bookmarks_emitter_.GetUpdateCounters();
502 } 502 }
503 503
504 const UpdateCounters& GetPasswordsUpdateCounters() { 504 const UpdateCounters& GetPasswordsUpdateCounters() {
505 return passwords_emitter_.GetUpdateCounters(); 505 return passwords_emitter_.GetUpdateCounters();
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 const UpdateCounters& counters = GetArticlesUpdateCounters(); 1156 const UpdateCounters& counters = GetArticlesUpdateCounters();
1157 EXPECT_EQ(1, counters.num_updates_applied); 1157 EXPECT_EQ(1, counters.num_updates_applied);
1158 EXPECT_EQ(1, counters.num_local_overwrites); 1158 EXPECT_EQ(1, counters.num_local_overwrites);
1159 EXPECT_EQ(0, counters.num_server_overwrites); 1159 EXPECT_EQ(0, counters.num_server_overwrites);
1160 local_metadata = entry_factory()->GetLocalAttachmentMetadataForItem(handle); 1160 local_metadata = entry_factory()->GetLocalAttachmentMetadataForItem(handle);
1161 EXPECT_EQ(server_metadata.SerializeAsString(), 1161 EXPECT_EQ(server_metadata.SerializeAsString(),
1162 local_metadata.SerializeAsString()); 1162 local_metadata.SerializeAsString());
1163 } 1163 }
1164 1164
1165 } // namespace syncer 1165 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine_impl/cycle/nudge_tracker.cc ('k') | components/sync/engine_impl/model_type_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698