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

Side by Side Diff: chrome/browser/password_manager/password_store_win_unittest.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky 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 "chrome/browser/password_manager/password_store_win.h" 5 #include "chrome/browser/password_manager/password_store_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 166 }
167 167
168 base::FilePath test_login_db_file_path() const { 168 base::FilePath test_login_db_file_path() const {
169 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test")); 169 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test"));
170 } 170 }
171 171
172 PasswordStoreWin* CreatePasswordStore() { 172 PasswordStoreWin* CreatePasswordStore() {
173 return new PasswordStoreWin( 173 return new PasswordStoreWin(
174 base::ThreadTaskRunnerHandle::Get(), 174 base::ThreadTaskRunnerHandle::Get(),
175 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), 175 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB),
176 base::WrapUnique(new LoginDatabase(test_login_db_file_path())), 176 base::MakeUnique<LoginDatabase>(test_login_db_file_path()), wds_.get());
177 wds_.get());
178 } 177 }
179 178
180 base::MessageLoopForUI message_loop_; 179 base::MessageLoopForUI message_loop_;
181 content::TestBrowserThread ui_thread_; 180 content::TestBrowserThread ui_thread_;
182 // PasswordStore, WDS schedule work on this thread. 181 // PasswordStore, WDS schedule work on this thread.
183 content::TestBrowserThread db_thread_; 182 content::TestBrowserThread db_thread_;
184 183
185 base::ScopedTempDir temp_dir_; 184 base::ScopedTempDir temp_dir_;
186 std::unique_ptr<TestingProfile> profile_; 185 std::unique_ptr<TestingProfile> profile_;
187 scoped_refptr<PasswordWebDataService> wds_; 186 scoped_refptr<PasswordWebDataService> wds_;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 446
448 // Make sure we quit the MessageLoop even if the test fails. 447 // Make sure we quit the MessageLoop even if the test fails.
449 ON_CALL(consumer, OnGetPasswordStoreResultsConstRef(_)) 448 ON_CALL(consumer, OnGetPasswordStoreResultsConstRef(_))
450 .WillByDefault(QuitUIMessageLoop()); 449 .WillByDefault(QuitUIMessageLoop());
451 450
452 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(IsEmpty())); 451 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(IsEmpty()));
453 452
454 store_->GetAutofillableLogins(&consumer); 453 store_->GetAutofillableLogins(&consumer);
455 base::RunLoop().Run(); 454 base::RunLoop().Run();
456 } 455 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698