| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "chrome/browser/password_manager/mock_password_store_service.h" | 6 #include "chrome/browser/password_manager/mock_password_store_service.h" |
| 7 #include "chrome/browser/password_manager/password_store_factory.h" | 7 #include "chrome/browser/password_manager/password_store_factory.h" |
| 8 #include "chrome/browser/ui/passwords/password_manager_presenter.h" | 8 #include "chrome/browser/ui/passwords/password_manager_presenter.h" |
| 9 #include "chrome/browser/ui/passwords/password_ui_view.h" | 9 #include "chrome/browser/ui/passwords/password_ui_view.h" |
| 10 #include "chrome/test/base/testing_profile.h" | 10 #include "chrome/test/base/testing_profile.h" |
| 11 #include "components/password_manager/core/browser/mock_password_store.h" | 11 #include "components/password_manager/core/browser/mock_password_store.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 using base::ASCIIToUTF16; | 15 using base::ASCIIToUTF16; |
| 16 using testing::Eq; | 16 using testing::Eq; |
| 17 using testing::Property; | 17 using testing::Property; |
| 18 | 18 |
| 19 class MockPasswordUIView : public PasswordUIView { | 19 class MockPasswordUIView : public PasswordUIView { |
| 20 public: | 20 public: |
| 21 explicit MockPasswordUIView(Profile* profile) | 21 explicit MockPasswordUIView(Profile* profile) |
| 22 : profile_(profile), password_manager_presenter_(this) { | 22 : profile_(profile), password_manager_presenter_(this) { |
| 23 password_manager_presenter_.Initialize(); | 23 password_manager_presenter_.Initialize(); |
| 24 } | 24 } |
| 25 virtual ~MockPasswordUIView() {} | 25 ~MockPasswordUIView() override {} |
| 26 virtual Profile* GetProfile() override; | 26 Profile* GetProfile() override; |
| 27 #if !defined(OS_ANDROID) | 27 #if !defined(OS_ANDROID) |
| 28 virtual gfx::NativeWindow GetNativeWindow() const override; | 28 gfx::NativeWindow GetNativeWindow() const override; |
| 29 #endif | 29 #endif |
| 30 MOCK_METHOD2(ShowPassword, void(size_t, const base::string16&)); | 30 MOCK_METHOD2(ShowPassword, void(size_t, const base::string16&)); |
| 31 MOCK_METHOD2(SetPasswordList, | 31 MOCK_METHOD2(SetPasswordList, |
| 32 void(const ScopedVector<autofill::PasswordForm>&, bool)); | 32 void(const ScopedVector<autofill::PasswordForm>&, bool)); |
| 33 MOCK_METHOD1(SetPasswordExceptionList, | 33 MOCK_METHOD1(SetPasswordExceptionList, |
| 34 void(const ScopedVector<autofill::PasswordForm>&)); | 34 void(const ScopedVector<autofill::PasswordForm>&)); |
| 35 PasswordManagerPresenter* GetPasswordManagerPresenter() { | 35 PasswordManagerPresenter* GetPasswordManagerPresenter() { |
| 36 return &password_manager_presenter_; | 36 return &password_manager_presenter_; |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 SetPasswordList( | 139 SetPasswordList( |
| 140 Property(&ScopedVector<autofill::PasswordForm>::size, Eq(2u)), | 140 Property(&ScopedVector<autofill::PasswordForm>::size, Eq(2u)), |
| 141 testing::_)); | 141 testing::_)); |
| 142 EXPECT_CALL(*GetUIController(), | 142 EXPECT_CALL(*GetUIController(), |
| 143 SetPasswordExceptionList(Property( | 143 SetPasswordExceptionList(Property( |
| 144 &ScopedVector<autofill::PasswordForm>::size, Eq(1u)))); | 144 &ScopedVector<autofill::PasswordForm>::size, Eq(1u)))); |
| 145 UpdateLists(); | 145 UpdateLists(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace | 148 } // namespace |
| OLD | NEW |