| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/optional.h" | 5 #include "base/optional.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "components/autofill/content/common/autofill_driver.mojom.h" | 7 #include "components/autofill/content/common/autofill_driver.mojom.h" |
| 8 #include "components/autofill/content/renderer/renderer_save_password_progress_l
ogger.h" | 8 #include "components/autofill/content/renderer/renderer_save_password_progress_l
ogger.h" |
| 9 #include "mojo/public/cpp/bindings/binding.h" | 9 #include "mojo/public/cpp/bindings/binding.h" |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 void RecordSavePasswordProgress(const std::string& log) override { | 67 void RecordSavePasswordProgress(const std::string& log) override { |
| 68 called_record_save_ = true; | 68 called_record_save_ = true; |
| 69 log_ = log; | 69 log_ = log; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void SaveGenerationFieldDetectedByClassifier( | 72 void SaveGenerationFieldDetectedByClassifier( |
| 73 const autofill::PasswordForm& password_form, | 73 const autofill::PasswordForm& password_form, |
| 74 const base::string16& generation_field) override {} | 74 const base::string16& generation_field) override {} |
| 75 | 75 |
| 76 void CheckSafeBrowsingReputation(const GURL& form_action, |
| 77 const GURL& frame_url) override {} |
| 78 |
| 76 // Records whether RecordSavePasswordProgress() gets called. | 79 // Records whether RecordSavePasswordProgress() gets called. |
| 77 bool called_record_save_; | 80 bool called_record_save_; |
| 78 // Records data received via RecordSavePasswordProgress() call. | 81 // Records data received via RecordSavePasswordProgress() call. |
| 79 base::Optional<std::string> log_; | 82 base::Optional<std::string> log_; |
| 80 | 83 |
| 81 mojo::Binding<mojom::PasswordManagerDriver> binding_; | 84 mojo::Binding<mojom::PasswordManagerDriver> binding_; |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 class TestLogger : public RendererSavePasswordProgressLogger { | 87 class TestLogger : public RendererSavePasswordProgressLogger { |
| 85 public: | 88 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 99 TestLogger logger(driver_ptr.get()); | 102 TestLogger logger(driver_ptr.get()); |
| 100 logger.SendLog(kTestText); | 103 logger.SendLog(kTestText); |
| 101 | 104 |
| 102 base::RunLoop().RunUntilIdle(); | 105 base::RunLoop().RunUntilIdle(); |
| 103 std::string sent_log; | 106 std::string sent_log; |
| 104 EXPECT_TRUE(fake_driver.GetLogMessage(&sent_log)); | 107 EXPECT_TRUE(fake_driver.GetLogMessage(&sent_log)); |
| 105 EXPECT_EQ(kTestText, sent_log); | 108 EXPECT_EQ(kTestText, sent_log); |
| 106 } | 109 } |
| 107 | 110 |
| 108 } // namespace autofill | 111 } // namespace autofill |
| OLD | NEW |