OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/save_password_infobar_delegate.h" | 6 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" |
7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 7 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
8 #include "components/autofill/core/common/password_form.h" | 8 #include "components/autofill/core/common/password_form.h" |
9 #include "components/password_manager/core/browser/password_form_manager.h" | 9 #include "components/password_manager/core/browser/password_form_manager.h" |
10 #include "components/password_manager/core/browser/password_manager_client.h" | 10 #include "components/password_manager/core/browser/password_manager_client.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 DISALLOW_COPY_AND_ASSIGN(MockPasswordFormManager); | 32 DISALLOW_COPY_AND_ASSIGN(MockPasswordFormManager); |
33 }; | 33 }; |
34 | 34 |
35 class TestSavePasswordInfobarDelegate : public SavePasswordInfoBarDelegate { | 35 class TestSavePasswordInfobarDelegate : public SavePasswordInfoBarDelegate { |
36 public: | 36 public: |
37 TestSavePasswordInfobarDelegate( | 37 TestSavePasswordInfobarDelegate( |
38 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 38 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
39 password_manager::CredentialSourceType source_type) | 39 password_manager::CredentialSourceType source_type) |
40 : SavePasswordInfoBarDelegate(form_to_save.Pass(), | 40 : SavePasswordInfoBarDelegate(form_to_save.Pass(), |
41 std::string(), | 41 std::string(), |
42 source_type) {} | 42 source_type, |
| 43 true /* is_smartlock_branding_enabled */) {} |
43 ~TestSavePasswordInfobarDelegate() override {} | 44 ~TestSavePasswordInfobarDelegate() override {} |
44 }; | 45 }; |
45 | 46 |
46 } // namespace | 47 } // namespace |
47 | 48 |
48 class SavePasswordInfoBarDelegateTest : public ChromeRenderViewHostTestHarness { | 49 class SavePasswordInfoBarDelegateTest : public ChromeRenderViewHostTestHarness { |
49 public: | 50 public: |
50 SavePasswordInfoBarDelegateTest(); | 51 SavePasswordInfoBarDelegateTest(); |
51 ~SavePasswordInfoBarDelegateTest() override{}; | 52 ~SavePasswordInfoBarDelegateTest() override{}; |
52 | 53 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 CancelTestCredentialSourcePasswordManager) { | 113 CancelTestCredentialSourcePasswordManager) { |
113 scoped_ptr<MockPasswordFormManager> password_form_manager( | 114 scoped_ptr<MockPasswordFormManager> password_form_manager( |
114 CreateMockFormManager()); | 115 CreateMockFormManager()); |
115 EXPECT_CALL(*password_form_manager.get(), PermanentlyBlacklist()) | 116 EXPECT_CALL(*password_form_manager.get(), PermanentlyBlacklist()) |
116 .Times(testing::Exactly(1)); | 117 .Times(testing::Exactly(1)); |
117 scoped_ptr<ConfirmInfoBarDelegate> infobar(CreateDelegate( | 118 scoped_ptr<ConfirmInfoBarDelegate> infobar(CreateDelegate( |
118 password_form_manager.Pass(), password_manager::CredentialSourceType:: | 119 password_form_manager.Pass(), password_manager::CredentialSourceType:: |
119 CREDENTIAL_SOURCE_PASSWORD_MANAGER)); | 120 CREDENTIAL_SOURCE_PASSWORD_MANAGER)); |
120 EXPECT_TRUE(infobar->Cancel()); | 121 EXPECT_TRUE(infobar->Cancel()); |
121 } | 122 } |
OLD | NEW |