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

Unified Diff: chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc

Issue 935303002: [Smart Lock] Measure clicks on the lock icon during Easy Unlock's trial run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
Index: chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
diff --git a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
index 1a72f764671401be55025c3d69765cbeb920722b..75aa1b298b488bdcbe4554b236d1a3ea3a3f99f7 100644
--- a/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
+++ b/chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc
@@ -2,13 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h"
+
#include <string>
#include <vector>
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h"
+#include "base/test/histogram_tester.h"
+#include "chrome/browser/signin/easy_unlock_metrics.h"
#include "chrome/browser/signin/easy_unlock_service.h"
#include "chrome/browser/signin/screenlock_bridge.h"
#include "chrome/grit/generated_resources.h"
@@ -751,4 +754,26 @@ TEST_F(EasyUnlockScreenlockStateHandlerTest, NoOverrideOnlineSignin) {
}
}
+TEST_F(EasyUnlockScreenlockStateHandlerTest, TrialRunMetrics) {
+ base::HistogramTester histogram_tester;
+
+ // Simulate the user clicking on the lock icon twice outside of a trial run.
+ // No trial run metrics should be recorded.
+ state_handler_->RecordClickOnLockIcon();
+ state_handler_->RecordClickOnLockIcon();
+ histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 0);
+
+ // Simulate the user clicking on the lock icon three times during a trial run.
+ state_handler_->SetTrialRun();
+ state_handler_->RecordClickOnLockIcon();
+ state_handler_->RecordClickOnLockIcon();
+ state_handler_->RecordClickOnLockIcon();
+ histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 4);
+ histogram_tester.ExpectBucketCount("EasyUnlock.TrialRun.Events",
+ EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED, 1);
+ histogram_tester.ExpectBucketCount(
+ "EasyUnlock.TrialRun.Events",
+ EASY_UNLOCK_TRIAL_RUN_EVENT_CLICKED_LOCK_ICON, 3);
+}
+
} // namespace
« no previous file with comments | « chrome/browser/signin/easy_unlock_screenlock_state_handler.cc ('k') | chrome/browser/signin/easy_unlock_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698