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

Side by Side Diff: components/sync_bookmarks/bookmark_data_type_controller_unittest.cc

Issue 2257793002: 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, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_bookmarks/bookmark_data_type_controller.h" 5 #include "components/sync_bookmarks/bookmark_data_type_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 base::Bind(&base::DoNothing), this); 82 base::Bind(&base::DoNothing), this);
83 } 83 }
84 84
85 protected: 85 protected:
86 enum BookmarkLoadPolicy { 86 enum BookmarkLoadPolicy {
87 DONT_LOAD_MODEL, 87 DONT_LOAD_MODEL,
88 LOAD_MODEL, 88 LOAD_MODEL,
89 }; 89 };
90 90
91 void CreateBookmarkModel(BookmarkLoadPolicy bookmark_load_policy) { 91 void CreateBookmarkModel(BookmarkLoadPolicy bookmark_load_policy) {
92 bookmark_model_.reset(new BookmarkModel( 92 bookmark_model_.reset(
93 base::WrapUnique(new bookmarks::TestBookmarkClient()))); 93 new BookmarkModel(base::MakeUnique<bookmarks::TestBookmarkClient>()));
94 if (bookmark_load_policy == LOAD_MODEL) { 94 if (bookmark_load_policy == LOAD_MODEL) {
95 TestingPrefServiceSimple prefs; 95 TestingPrefServiceSimple prefs;
96 bookmark_model_->Load(&prefs, base::FilePath(), 96 bookmark_model_->Load(&prefs, base::FilePath(),
97 base::ThreadTaskRunnerHandle::Get(), 97 base::ThreadTaskRunnerHandle::Get(),
98 base::ThreadTaskRunnerHandle::Get()); 98 base::ThreadTaskRunnerHandle::Get());
99 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_.get()); 99 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model_.get());
100 } 100 }
101 } 101 }
102 102
103 void SetStartExpectations() { 103 void SetStartExpectations() {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 SetStopExpectations(); 297 SetStopExpectations();
298 298
299 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); 299 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state());
300 300
301 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _)); 301 EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _));
302 Start(); 302 Start();
303 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state()); 303 EXPECT_EQ(DataTypeController::RUNNING, bookmark_dtc_->state());
304 bookmark_dtc_->Stop(); 304 bookmark_dtc_->Stop();
305 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state()); 305 EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state());
306 } 306 }
OLDNEW
« no previous file with comments | « components/suggestions/image_encoder_ios.mm ('k') | components/sync_sessions/favicon_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698