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

Unified Diff: chrome/renderer/autofill/password_generation_agent_browsertest.cc

Issue 643493003: [Password Generation] Update UMA stats for popups per page not per event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_generation_agent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e19951333c734e0523615bc6824792b0db899bc7 100644
--- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
@@ -6,11 +6,13 @@
#include "base/memory/scoped_ptr.h"
#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"
@@ -256,6 +258,8 @@ TEST_F(PasswordGenerationAgentTest, AccountCreationFormsDetectedTest) {
}
TEST_F(PasswordGenerationAgentTest, MaximumOfferSize) {
+ base::HistogramTester histogram_tester;
+
LoadHTML(kAccountCreationFormHTML);
SetNotBlacklistedMessage(kAccountCreationFormHTML);
SetAccountCreationFormsDetectedMessage(kAccountCreationFormHTML);
@@ -328,6 +332,15 @@ 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);
+
+ histogram_tester.ExpectBucketCount(
+ "PasswordGeneration.Event",
+ autofill::password_generation::GENERATION_POPUP_SHOWN,
+ 1);
}
} // namespace autofill
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_generation_agent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698