| 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 <wincrypt.h> | 6 #include <wincrypt.h> |
| 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 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/browser/webdata/logins_table.h" | 22 #include "chrome/browser/webdata/logins_table.h" |
| 23 #include "chrome/browser/webdata/web_data_service.h" | 23 #include "chrome/browser/webdata/web_data_service.h" |
| 24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 25 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
| 26 #include "components/webdata/common/web_database_service.h" | 26 #include "components/webdata/common/web_database_service.h" |
| 27 #include "components/webdata/encryptor/ie7_password.h" | 27 #include "components/webdata/encryptor/ie7_password.h" |
| 28 #include "content/public/test/test_browser_thread.h" | 28 #include "content/public/test/test_browser_thread.h" |
| 29 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
| 30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 | 31 |
| 32 using autofill::PasswordForm; |
| 32 using base::WaitableEvent; | 33 using base::WaitableEvent; |
| 33 using content::BrowserThread; | 34 using content::BrowserThread; |
| 34 using testing::_; | 35 using testing::_; |
| 35 using testing::DoAll; | 36 using testing::DoAll; |
| 36 using testing::WithArg; | 37 using testing::WithArg; |
| 37 using content::PasswordForm; | |
| 38 | 38 |
| 39 namespace { | 39 namespace { |
| 40 | 40 |
| 41 class MockPasswordStoreConsumer : public PasswordStoreConsumer { | 41 class MockPasswordStoreConsumer : public PasswordStoreConsumer { |
| 42 public: | 42 public: |
| 43 MOCK_METHOD2(OnPasswordStoreRequestDone, | 43 MOCK_METHOD2(OnPasswordStoreRequestDone, |
| 44 void(CancelableRequestProvider::Handle, | 44 void(CancelableRequestProvider::Handle, |
| 45 const std::vector<content::PasswordForm*>&)); | 45 const std::vector<autofill::PasswordForm*>&)); |
| 46 MOCK_METHOD1(OnGetPasswordStoreResults, | 46 MOCK_METHOD1(OnGetPasswordStoreResults, |
| 47 void(const std::vector<content::PasswordForm*>&)); | 47 void(const std::vector<autofill::PasswordForm*>&)); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class MockWebDataServiceConsumer : public WebDataServiceConsumer { | 50 class MockWebDataServiceConsumer : public WebDataServiceConsumer { |
| 51 public: | 51 public: |
| 52 MOCK_METHOD2(OnWebDataServiceRequestDone, | 52 MOCK_METHOD2(OnWebDataServiceRequestDone, |
| 53 void(WebDataService::Handle, const WDTypedResult*)); | 53 void(WebDataService::Handle, const WDTypedResult*)); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // anonymous namespace | 56 } // anonymous namespace |
| 57 | 57 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 VectorOfForms expect_none; | 421 VectorOfForms expect_none; |
| 422 // expect that we get no results; | 422 // expect that we get no results; |
| 423 EXPECT_CALL( | 423 EXPECT_CALL( |
| 424 consumer, | 424 consumer, |
| 425 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none))) | 425 OnPasswordStoreRequestDone(_, ContainsAllPasswordForms(expect_none))) |
| 426 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); | 426 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); |
| 427 | 427 |
| 428 store_->GetAutofillableLogins(&consumer); | 428 store_->GetAutofillableLogins(&consumer); |
| 429 base::MessageLoop::current()->Run(); | 429 base::MessageLoop::current()->Run(); |
| 430 } | 430 } |
| OLD | NEW |