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

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

Issue 1125653002: [chrome/browser/password_manager] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 <windows.h> 5 #include <windows.h>
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
12 #include "base/files/scoped_temp_dir.h" 12 #include "base/files/scoped_temp_dir.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
vabr (Chromium) 2015/05/04 16:10:12 Is this #include still needed?
Pranay 2015/05/05 03:14:57 Hi Vabr, Yes it's still needed for base::MessageL
vabr (Chromium) 2015/05/05 03:18:39 Acknowledged.
15 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/synchronization/waitable_event.h" 17 #include "base/synchronization/waitable_event.h"
18 #include "base/thread_task_runner_handle.h"
18 #include "base/time/time.h" 19 #include "base/time/time.h"
19 #include "chrome/browser/password_manager/password_store_win.h" 20 #include "chrome/browser/password_manager/password_store_win.h"
20 #include "chrome/test/base/testing_profile.h" 21 #include "chrome/test/base/testing_profile.h"
21 #include "components/os_crypt/ie7_password_win.h" 22 #include "components/os_crypt/ie7_password_win.h"
22 #include "components/password_manager/core/browser/password_manager_test_utils.h " 23 #include "components/password_manager/core/browser/password_manager_test_utils.h "
23 #include "components/password_manager/core/browser/password_store_consumer.h" 24 #include "components/password_manager/core/browser/password_store_consumer.h"
24 #include "components/password_manager/core/browser/webdata/logins_table.h" 25 #include "components/password_manager/core/browser/webdata/logins_table.h"
25 #include "components/password_manager/core/browser/webdata/password_web_data_ser vice_win.h" 26 #include "components/password_manager/core/browser/webdata/password_web_data_ser vice_win.h"
26 #include "components/password_manager/core/common/password_manager_pref_names.h" 27 #include "components/password_manager/core/common/password_manager_pref_names.h"
27 #include "components/webdata/common/web_database_service.h" 28 #include "components/webdata/common/web_database_service.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 base::MessageLoop::current()->Run(); 151 base::MessageLoop::current()->Run();
151 db_thread_.Stop(); 152 db_thread_.Stop();
152 } 153 }
153 154
154 base::FilePath test_login_db_file_path() const { 155 base::FilePath test_login_db_file_path() const {
155 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test")); 156 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test"));
156 } 157 }
157 158
158 PasswordStoreWin* CreatePasswordStore() { 159 PasswordStoreWin* CreatePasswordStore() {
159 return new PasswordStoreWin( 160 return new PasswordStoreWin(
160 base::MessageLoopProxy::current(), 161 base::ThreadTaskRunnerHandle::Get(),
161 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), 162 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
162 make_scoped_ptr(new LoginDatabase(test_login_db_file_path())), 163 make_scoped_ptr(new LoginDatabase(test_login_db_file_path())),
163 wds_.get()); 164 wds_.get());
164 } 165 }
165 166
166 base::MessageLoopForUI message_loop_; 167 base::MessageLoopForUI message_loop_;
167 content::TestBrowserThread ui_thread_; 168 content::TestBrowserThread ui_thread_;
168 // PasswordStore, WDS schedule work on this thread. 169 // PasswordStore, WDS schedule work on this thread.
169 content::TestBrowserThread db_thread_; 170 content::TestBrowserThread db_thread_;
170 171
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 422
422 // Make sure we quit the MessageLoop even if the test fails. 423 // Make sure we quit the MessageLoop even if the test fails.
423 ON_CALL(consumer, OnGetPasswordStoreResultsConstRef(_)) 424 ON_CALL(consumer, OnGetPasswordStoreResultsConstRef(_))
424 .WillByDefault(QuitUIMessageLoop()); 425 .WillByDefault(QuitUIMessageLoop());
425 426
426 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(IsEmpty())); 427 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(IsEmpty()));
427 428
428 store_->GetAutofillableLogins(&consumer); 429 store_->GetAutofillableLogins(&consumer);
429 base::MessageLoop::current()->Run(); 430 base::MessageLoop::current()->Run();
430 } 431 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698