Chromium Code Reviews| Index: chrome/renderer/autofill/password_generation_agent_browsertest.cc |
| diff --git a/chrome/renderer/autofill/password_generation_agent_browsertest.cc b/chrome/renderer/autofill/password_generation_agent_browsertest.cc |
| index 60bdaa3efa8a9c77e86dc2d7997968038f342b55..67d04db68212e34216fa563bc35a423dc7f39aaf 100644 |
| --- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc |
| +++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc |
| @@ -5,12 +5,16 @@ |
| #include <string.h> |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/metrics/histogram_samples.h" |
| +#include "base/metrics/statistics_recorder.h" |
|
Ilya Sherman
2014/10/14 20:17:20
nit: Are these two still needed?
Garrett Casto
2014/10/15 00:10:01
Done.
|
| #include "base/strings/utf_string_conversions.h" |
| +#include "base/test/histogram_tester.h" |
| #include "chrome/test/base/chrome_render_view_test.h" |
| #include "components/autofill/content/common/autofill_messages.h" |
| #include "components/autofill/content/renderer/autofill_agent.h" |
| #include "components/autofill/content/renderer/test_password_generation_agent.h" |
| #include "components/autofill/core/common/form_data.h" |
| +#include "components/autofill/core/common/password_generation_util.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "third_party/WebKit/public/platform/WebString.h" |
| #include "third_party/WebKit/public/web/WebDocument.h" |
| @@ -328,6 +332,16 @@ TEST_F(PasswordGenerationAgentTest, MaximumOfferSize) { |
| EXPECT_EQ(AutofillHostMsg_ShowPasswordGenerationPopup::ID, |
| password_generation_->messages()[0]->type()); |
| password_generation_->clear_messages(); |
| + |
| + // Loading a different page triggers UMA stat upload. Verify that only one |
| + // display event is sent even though |
| + LoadHTML(kSigninFormHTML); |
| + |
| + base::HistogramTester histogram_tester; |
| + histogram_tester->ExpectBucketCount( |
| + "PasswordGeneration.Event", |
| + autofill::password_generation::GENERATION_POPUP_SHOWN, |
| + 1); |
| } |
| } // namespace autofill |