Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: components/autofill/content/renderer/renderer_save_password_progress_logger_unittest.cc

Issue 2833193002: Trigger Password Protection ping on username/password field on focus (Closed)
Patch Set: nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) override {}
77
76 // Records whether RecordSavePasswordProgress() gets called. 78 // Records whether RecordSavePasswordProgress() gets called.
77 bool called_record_save_; 79 bool called_record_save_;
78 // Records data received via RecordSavePasswordProgress() call. 80 // Records data received via RecordSavePasswordProgress() call.
79 base::Optional<std::string> log_; 81 base::Optional<std::string> log_;
80 82
81 mojo::Binding<mojom::PasswordManagerDriver> binding_; 83 mojo::Binding<mojom::PasswordManagerDriver> binding_;
82 }; 84 };
83 85
84 class TestLogger : public RendererSavePasswordProgressLogger { 86 class TestLogger : public RendererSavePasswordProgressLogger {
85 public: 87 public:
(...skipping 13 matching lines...) Expand all
99 TestLogger logger(driver_ptr.get()); 101 TestLogger logger(driver_ptr.get());
100 logger.SendLog(kTestText); 102 logger.SendLog(kTestText);
101 103
102 base::RunLoop().RunUntilIdle(); 104 base::RunLoop().RunUntilIdle();
103 std::string sent_log; 105 std::string sent_log;
104 EXPECT_TRUE(fake_driver.GetLogMessage(&sent_log)); 106 EXPECT_TRUE(fake_driver.GetLogMessage(&sent_log));
105 EXPECT_EQ(kTestText, sent_log); 107 EXPECT_EQ(kTestText, sent_log);
106 } 108 }
107 109
108 } // namespace autofill 110 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698