| 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 "chrome/browser/password_manager/save_password_infobar_delegate.h" | 5 #include "chrome/browser/password_manager/save_password_infobar_delegate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class TestSavePasswordInfobarDelegate : public SavePasswordInfoBarDelegate { | 44 class TestSavePasswordInfobarDelegate : public SavePasswordInfoBarDelegate { |
| 45 public: | 45 public: |
| 46 TestSavePasswordInfobarDelegate( | 46 TestSavePasswordInfobarDelegate( |
| 47 content::WebContents* web_contents, | 47 content::WebContents* web_contents, |
| 48 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 48 scoped_ptr<password_manager::PasswordFormManager> form_to_save, |
| 49 bool should_show_first_run_experience) | 49 bool should_show_first_run_experience) |
| 50 : SavePasswordInfoBarDelegate(web_contents, | 50 : SavePasswordInfoBarDelegate(web_contents, |
| 51 std::move(form_to_save), | 51 std::move(form_to_save), |
| 52 std::string(), | |
| 53 true /* is_smartlock_branding_enabled */, | 52 true /* is_smartlock_branding_enabled */, |
| 54 should_show_first_run_experience) {} | 53 should_show_first_run_experience) {} |
| 55 | 54 |
| 56 ~TestSavePasswordInfobarDelegate() override {} | 55 ~TestSavePasswordInfobarDelegate() override {} |
| 57 }; | 56 }; |
| 58 | 57 |
| 59 } // namespace | 58 } // namespace |
| 60 | 59 |
| 61 class SavePasswordInfoBarDelegateTest : public ChromeRenderViewHostTestHarness { | 60 class SavePasswordInfoBarDelegateTest : public ChromeRenderViewHostTestHarness { |
| 62 public: | 61 public: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 password_manager::prefs::kWasSavePrompFirstRunExperienceShown, false); | 163 password_manager::prefs::kWasSavePrompFirstRunExperienceShown, false); |
| 165 scoped_ptr<MockPasswordFormManager> password_form_manager( | 164 scoped_ptr<MockPasswordFormManager> password_form_manager( |
| 166 CreateMockFormManager()); | 165 CreateMockFormManager()); |
| 167 scoped_ptr<ConfirmInfoBarDelegate> infobar( | 166 scoped_ptr<ConfirmInfoBarDelegate> infobar( |
| 168 CreateDelegate(std::move(password_form_manager), false)); | 167 CreateDelegate(std::move(password_form_manager), false)); |
| 169 EXPECT_TRUE(infobar->Cancel()); | 168 EXPECT_TRUE(infobar->Cancel()); |
| 170 infobar.reset(); | 169 infobar.reset(); |
| 171 EXPECT_FALSE(prefs()->GetBoolean( | 170 EXPECT_FALSE(prefs()->GetBoolean( |
| 172 password_manager::prefs::kWasSavePrompFirstRunExperienceShown)); | 171 password_manager::prefs::kWasSavePrompFirstRunExperienceShown)); |
| 173 } | 172 } |
| OLD | NEW |