| 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 #include <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include <wincrypt.h> | 8 #include <wincrypt.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 login_db_.reset(new LoginDatabase()); | 112 login_db_.reset(new LoginDatabase()); |
| 113 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( | 113 ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append( |
| 114 FILE_PATH_LITERAL("login_test")))); | 114 FILE_PATH_LITERAL("login_test")))); |
| 115 | 115 |
| 116 wds_ = new WebDataService(); | 116 wds_ = new WebDataService(); |
| 117 ASSERT_TRUE(wds_->Init(temp_dir_.path())); | 117 ASSERT_TRUE(wds_->Init(temp_dir_.path())); |
| 118 } | 118 } |
| 119 | 119 |
| 120 virtual void TearDown() { | 120 virtual void TearDown() { |
| 121 if (store_.get()) | 121 if (store_.get()) |
| 122 store_->Shutdown(); | 122 store_->ShutdownOnUIThread(); |
| 123 if (wds_.get()) | 123 if (wds_.get()) |
| 124 wds_->Shutdown(); | 124 wds_->Shutdown(); |
| 125 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 125 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 126 MessageLoop::current()->Run(); | 126 MessageLoop::current()->Run(); |
| 127 db_thread_.Stop(); | 127 db_thread_.Stop(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 MessageLoopForUI message_loop_; | 130 MessageLoopForUI message_loop_; |
| 131 content::TestBrowserThread ui_thread_; | 131 content::TestBrowserThread ui_thread_; |
| 132 // PasswordStore, WDS schedule work on this thread. | 132 // PasswordStore, WDS schedule work on this thread. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 L"", | 253 L"", |
| 254 L"", | 254 L"", |
| 255 true, false, 1, | 255 true, false, 1, |
| 256 }; | 256 }; |
| 257 scoped_ptr<PasswordForm> form(CreatePasswordFormFromData(form_data)); | 257 scoped_ptr<PasswordForm> form(CreatePasswordFormFromData(form_data)); |
| 258 | 258 |
| 259 MockPasswordStoreConsumer consumer; | 259 MockPasswordStoreConsumer consumer; |
| 260 store_->GetLogins(*form, &consumer); | 260 store_->GetLogins(*form, &consumer); |
| 261 | 261 |
| 262 // Release the PSW and the WDS before the query can return. | 262 // Release the PSW and the WDS before the query can return. |
| 263 store_->Shutdown(); | 263 store_->ShutdownOnUIThread(); |
| 264 store_ = NULL; | 264 store_ = NULL; |
| 265 wds_->Shutdown(); | 265 wds_->Shutdown(); |
| 266 wds_ = NULL; | 266 wds_ = NULL; |
| 267 | 267 |
| 268 MessageLoop::current()->RunAllPending(); | 268 MessageLoop::current()->RunAllPending(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 // Hangs flakily, see http://crbug.com/43836. | 271 // Hangs flakily, see http://crbug.com/43836. |
| 272 TEST_F(PasswordStoreWinTest, DISABLED_MultipleWDSQueriesOnDifferentThreads) { | 272 TEST_F(PasswordStoreWinTest, DISABLED_MultipleWDSQueriesOnDifferentThreads) { |
| 273 IE7PasswordInfo password_info; | 273 IE7PasswordInfo password_info; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 | 587 |
| 588 VectorOfForms expect_none; | 588 VectorOfForms expect_none; |
| 589 // expect that we get no results; | 589 // expect that we get no results; |
| 590 EXPECT_CALL(consumer, OnPasswordStoreRequestDone( | 590 EXPECT_CALL(consumer, OnPasswordStoreRequestDone( |
| 591 _, ContainsAllPasswordForms(expect_none))) | 591 _, ContainsAllPasswordForms(expect_none))) |
| 592 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); | 592 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); |
| 593 | 593 |
| 594 store_->GetAutofillableLogins(&consumer); | 594 store_->GetAutofillableLogins(&consumer); |
| 595 MessageLoop::current()->Run(); | 595 MessageLoop::current()->Run(); |
| 596 } | 596 } |
| OLD | NEW |