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

Unified Diff: components/autofill/core/browser/autofill_external_delegate_unittest.cc

Issue 2137153002: [Autofill] Implement Impression metric for signin promo in CC dropdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « components/autofill/core/browser/autofill_external_delegate.cc ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/autofill_external_delegate_unittest.cc
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
index fb67541dcefee4a0e15ae49b9dab2f167e8b32d9..62e964d6b22ccfef514721b978fcad1a55307563 100644
--- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -12,6 +12,7 @@
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/histogram_tester.h"
+#include "base/test/user_action_tester.h"
#include "build/build_config.h"
#include "components/autofill/core/browser/autofill_manager.h"
#include "components/autofill/core/browser/autofill_metrics.h"
@@ -216,11 +217,15 @@ TEST_F(AutofillExternalDelegateUnitTest, TestSigninPromoIsAdded) {
EXPECT_CALL(autofill_client_,
ShowAutofillPopup(_, _, SuggestionVectorIdsAre(element_ids), _));
+ base::UserActionTester user_action_tester;
+
// This should call ShowAutofillPopup.
std::vector<Suggestion> autofill_item;
autofill_item.push_back(Suggestion());
autofill_item[0].frontend_id = kAutofillProfileId;
external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item);
+ EXPECT_EQ(1, user_action_tester.GetActionCount(
+ "Signin_Impression_FromAutofillDropdown"));
EXPECT_CALL(
*autofill_manager_,
« no previous file with comments | « components/autofill/core/browser/autofill_external_delegate.cc ('k') | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698