OLD | NEW |
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" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 if (store_.get()) | 139 if (store_.get()) |
140 store_->Shutdown(); | 140 store_->Shutdown(); |
141 wds_->ShutdownOnUIThread(); | 141 wds_->ShutdownOnUIThread(); |
142 wdbs_->ShutdownDatabase(); | 142 wdbs_->ShutdownDatabase(); |
143 wds_ = nullptr; | 143 wds_ = nullptr; |
144 wdbs_ = nullptr; | 144 wdbs_ = nullptr; |
145 base::WaitableEvent done(false, false); | 145 base::WaitableEvent done(false, false); |
146 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 146 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
147 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); | 147 base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); |
148 done.Wait(); | 148 done.Wait(); |
149 base::MessageLoop::current()->PostTask(FROM_HERE, | 149 base::MessageLoop::current()->PostTask( |
150 base::MessageLoop::QuitClosure()); | 150 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
151 base::MessageLoop::current()->Run(); | 151 base::MessageLoop::current()->Run(); |
152 db_thread_.Stop(); | 152 db_thread_.Stop(); |
153 } | 153 } |
154 | 154 |
155 base::FilePath test_login_db_file_path() const { | 155 base::FilePath test_login_db_file_path() const { |
156 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test")); | 156 return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test")); |
157 } | 157 } |
158 | 158 |
159 PasswordStoreWin* CreatePasswordStore() { | 159 PasswordStoreWin* CreatePasswordStore() { |
160 return new PasswordStoreWin( | 160 return new PasswordStoreWin( |
(...skipping 14 matching lines...) Expand all Loading... |
175 scoped_refptr<WebDatabaseService> wdbs_; | 175 scoped_refptr<WebDatabaseService> wdbs_; |
176 scoped_refptr<PasswordStore> store_; | 176 scoped_refptr<PasswordStore> store_; |
177 }; | 177 }; |
178 | 178 |
179 ACTION(STLDeleteElements0) { | 179 ACTION(STLDeleteElements0) { |
180 STLDeleteContainerPointers(arg0.begin(), arg0.end()); | 180 STLDeleteContainerPointers(arg0.begin(), arg0.end()); |
181 } | 181 } |
182 | 182 |
183 ACTION(QuitUIMessageLoop) { | 183 ACTION(QuitUIMessageLoop) { |
184 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 184 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
185 base::MessageLoop::current()->Quit(); | 185 base::MessageLoop::current()->QuitWhenIdle(); |
186 } | 186 } |
187 | 187 |
188 MATCHER(EmptyWDResult, "") { | 188 MATCHER(EmptyWDResult, "") { |
189 return static_cast<const WDResult<std::vector<PasswordForm*> >*>( | 189 return static_cast<const WDResult<std::vector<PasswordForm*> >*>( |
190 arg)->GetValue().empty(); | 190 arg)->GetValue().empty(); |
191 } | 191 } |
192 | 192 |
193 // Hangs flakily, http://crbug.com/71385. | 193 // Hangs flakily, http://crbug.com/71385. |
194 TEST_F(PasswordStoreWinTest, DISABLED_ConvertIE7Login) { | 194 TEST_F(PasswordStoreWinTest, DISABLED_ConvertIE7Login) { |
195 IE7PasswordInfo password_info; | 195 IE7PasswordInfo password_info; |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 // Make sure we quit the MessageLoop even if the test fails. | 423 // Make sure we quit the MessageLoop even if the test fails. |
424 ON_CALL(consumer, OnGetPasswordStoreResultsConstRef(_)) | 424 ON_CALL(consumer, OnGetPasswordStoreResultsConstRef(_)) |
425 .WillByDefault(QuitUIMessageLoop()); | 425 .WillByDefault(QuitUIMessageLoop()); |
426 | 426 |
427 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(IsEmpty())); | 427 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(IsEmpty())); |
428 | 428 |
429 store_->GetAutofillableLogins(&consumer); | 429 store_->GetAutofillableLogins(&consumer); |
430 base::MessageLoop::current()->Run(); | 430 base::MessageLoop::current()->Run(); |
431 } | 431 } |
OLD | NEW |