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

Side by Side Diff: components/omnibox/browser/shortcuts_backend_unittest.cc

Issue 2252343002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 (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/omnibox/browser/shortcuts_backend.h" 5 #include "components/omnibox/browser/shortcuts_backend.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void ShortcutsBackendTest::SetUp() { 113 void ShortcutsBackendTest::SetUp() {
114 template_url_service_.reset(new TemplateURLService(nullptr, 0)); 114 template_url_service_.reset(new TemplateURLService(nullptr, 0));
115 if (profile_dir_.CreateUniqueTempDir()) 115 if (profile_dir_.CreateUniqueTempDir())
116 history_service_ = history::CreateHistoryService(profile_dir_.path(), true); 116 history_service_ = history::CreateHistoryService(profile_dir_.path(), true);
117 ASSERT_TRUE(history_service_); 117 ASSERT_TRUE(history_service_);
118 118
119 db_thread_.Start(); 119 db_thread_.Start();
120 base::FilePath shortcuts_database_path = 120 base::FilePath shortcuts_database_path =
121 profile_dir_.path().Append(kShortcutsDatabaseName); 121 profile_dir_.path().Append(kShortcutsDatabaseName);
122 backend_ = new ShortcutsBackend( 122 backend_ = new ShortcutsBackend(
123 template_url_service_.get(), base::WrapUnique(new SearchTermsData()), 123 template_url_service_.get(), base::MakeUnique<SearchTermsData>(),
124 history_service_.get(), db_thread_.task_runner(), shortcuts_database_path, 124 history_service_.get(), db_thread_.task_runner(), shortcuts_database_path,
125 false); 125 false);
126 ASSERT_TRUE(backend_.get()); 126 ASSERT_TRUE(backend_.get());
127 backend_->AddObserver(this); 127 backend_->AddObserver(this);
128 } 128 }
129 129
130 void ShortcutsBackendTest::TearDown() { 130 void ShortcutsBackendTest::TearDown() {
131 backend_->RemoveObserver(this); 131 backend_->RemoveObserver(this);
132 db_thread_.Stop(); 132 db_thread_.Stop();
133 } 133 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 ASSERT_TRUE(shortcut4_iter != shortcuts_map().end()); 316 ASSERT_TRUE(shortcut4_iter != shortcuts_map().end());
317 EXPECT_EQ(shortcut4.id, shortcut4_iter->second.id); 317 EXPECT_EQ(shortcut4.id, shortcut4_iter->second.id);
318 318
319 ShortcutsDatabase::ShortcutIDs deleted_ids; 319 ShortcutsDatabase::ShortcutIDs deleted_ids;
320 deleted_ids.push_back(shortcut3.id); 320 deleted_ids.push_back(shortcut3.id);
321 deleted_ids.push_back(shortcut4.id); 321 deleted_ids.push_back(shortcut4.id);
322 EXPECT_TRUE(DeleteShortcutsWithIDs(deleted_ids)); 322 EXPECT_TRUE(DeleteShortcutsWithIDs(deleted_ids));
323 323
324 ASSERT_EQ(0U, shortcuts_map().size()); 324 ASSERT_EQ(0U, shortcuts_map().size());
325 } 325 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/scored_history_match_unittest.cc ('k') | components/omnibox/browser/shortcuts_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698