| 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 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
| 26 #include "content/public/test/test_browser_thread.h" | 26 #include "content/public/test/test_browser_thread.h" |
| 27 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 | 29 |
| 30 using base::WaitableEvent; | 30 using base::WaitableEvent; |
| 31 using content::BrowserThread; | 31 using content::BrowserThread; |
| 32 using testing::_; | 32 using testing::_; |
| 33 using testing::DoAll; | 33 using testing::DoAll; |
| 34 using testing::WithArg; | 34 using testing::WithArg; |
| 35 using webkit::forms::PasswordForm; | 35 using content::PasswordForm; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class MockPasswordStoreConsumer : public PasswordStoreConsumer { | 39 class MockPasswordStoreConsumer : public PasswordStoreConsumer { |
| 40 public: | 40 public: |
| 41 MOCK_METHOD2(OnPasswordStoreRequestDone, | 41 MOCK_METHOD2(OnPasswordStoreRequestDone, |
| 42 void(CancelableRequestProvider::Handle, | 42 void(CancelableRequestProvider::Handle, |
| 43 const std::vector<webkit::forms::PasswordForm*>&)); | 43 const std::vector<content::PasswordForm*>&)); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 class MockWebDataServiceConsumer : public WebDataServiceConsumer { | 46 class MockWebDataServiceConsumer : public WebDataServiceConsumer { |
| 47 public: | 47 public: |
| 48 MOCK_METHOD2(OnWebDataServiceRequestDone, | 48 MOCK_METHOD2(OnWebDataServiceRequestDone, |
| 49 void(WebDataService::Handle, const WDTypedResult*)); | 49 void(WebDataService::Handle, const WDTypedResult*)); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 } // anonymous namespace | 52 } // anonymous namespace |
| 53 | 53 |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 406 |
| 407 VectorOfForms expect_none; | 407 VectorOfForms expect_none; |
| 408 // expect that we get no results; | 408 // expect that we get no results; |
| 409 EXPECT_CALL(consumer, OnPasswordStoreRequestDone( | 409 EXPECT_CALL(consumer, OnPasswordStoreRequestDone( |
| 410 _, ContainsAllPasswordForms(expect_none))) | 410 _, ContainsAllPasswordForms(expect_none))) |
| 411 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); | 411 .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); |
| 412 | 412 |
| 413 store_->GetAutofillableLogins(&consumer); | 413 store_->GetAutofillableLogins(&consumer); |
| 414 MessageLoop::current()->Run(); | 414 MessageLoop::current()->Run(); |
| 415 } | 415 } |
| OLD | NEW |