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

Side by Side Diff: components/password_manager/content/browser/credential_manager_impl_unittest.cc

Issue 2037843002: Remove use of deprecated MessageLoop methods in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change precache Created 4 years, 6 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/password_manager/content/browser/credential_manager_impl.h" 5 #include "components/password_manager/content/browser/credential_manager_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <tuple> 10 #include <tuple>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "base/location.h"
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/memory/ptr_util.h" 17 #include "base/memory/ptr_util.h"
17 #include "base/run_loop.h" 18 #include "base/run_loop.h"
19 #include "base/single_thread_task_runner.h"
18 #include "base/strings/string16.h" 20 #include "base/strings/string16.h"
19 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
20 #include "base/threading/thread_task_runner_handle.h" 22 #include "base/threading/thread_task_runner_handle.h"
21 #include "components/password_manager/content/public/cpp/type_converters.h" 23 #include "components/password_manager/content/public/cpp/type_converters.h"
22 #include "components/password_manager/core/browser/credential_manager_password_f orm_manager.h" 24 #include "components/password_manager/core/browser/credential_manager_password_f orm_manager.h"
23 #include "components/password_manager/core/browser/mock_affiliated_match_helper. h" 25 #include "components/password_manager/core/browser/mock_affiliated_match_helper. h"
24 #include "components/password_manager/core/browser/password_manager.h" 26 #include "components/password_manager/core/browser/password_manager.h"
25 #include "components/password_manager/core/browser/stub_password_manager_client. h" 27 #include "components/password_manager/core/browser/stub_password_manager_client. h"
26 #include "components/password_manager/core/browser/stub_password_manager_driver. h" 28 #include "components/password_manager/core/browser/stub_password_manager_driver. h"
27 #include "components/password_manager/core/browser/test_password_store.h" 29 #include "components/password_manager/core/browser/test_password_store.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 PasswordManagerDriver* driver) 154 PasswordManagerDriver* driver)
153 : CredentialManagerImpl(web_contents, client), 155 : CredentialManagerImpl(web_contents, client),
154 driver_(driver->AsWeakPtr()) {} 156 driver_(driver->AsWeakPtr()) {}
155 157
156 base::WeakPtr<PasswordManagerDriver> TestCredentialManagerImpl::GetDriver() { 158 base::WeakPtr<PasswordManagerDriver> TestCredentialManagerImpl::GetDriver() {
157 return driver_; 159 return driver_;
158 } 160 }
159 161
160 void RunAllPendingTasks() { 162 void RunAllPendingTasks() {
161 base::RunLoop run_loop; 163 base::RunLoop run_loop;
162 base::MessageLoop::current()->PostTask( 164 base::ThreadTaskRunnerHandle::Get()->PostTask(
163 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); 165 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
164 run_loop.Run(); 166 run_loop.Run();
165 } 167 }
166 168
167 class SlightlyLessStubbyPasswordManagerDriver 169 class SlightlyLessStubbyPasswordManagerDriver
168 : public StubPasswordManagerDriver { 170 : public StubPasswordManagerDriver {
169 public: 171 public:
170 explicit SlightlyLessStubbyPasswordManagerDriver( 172 explicit SlightlyLessStubbyPasswordManagerDriver(
171 PasswordManagerClient* client) 173 PasswordManagerClient* client)
172 : password_manager_(client) {} 174 : password_manager_(client) {}
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 _, CredentialSourceType::CREDENTIAL_SOURCE_API)); 1302 _, CredentialSourceType::CREDENTIAL_SOURCE_API));
1301 CallStore(info, base::Bind(&RespondCallback, &called)); 1303 CallStore(info, base::Bind(&RespondCallback, &called));
1302 // Allow the PasswordFormManager to talk to the password store 1304 // Allow the PasswordFormManager to talk to the password store
1303 RunAllPendingTasks(); 1305 RunAllPendingTasks();
1304 1306
1305 ASSERT_TRUE(client_->pending_manager()); 1307 ASSERT_TRUE(client_->pending_manager());
1306 EXPECT_TRUE(client_->pending_manager()->IsBlacklisted()); 1308 EXPECT_TRUE(client_->pending_manager()->IsBlacklisted());
1307 } 1309 }
1308 1310
1309 } // namespace password_manager 1311 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698