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

Unified Diff: chrome/test/data/webui/settings/fake_quick_unlock_uma.js

Issue 2313103002: Added uma for pin unlock set up. (Closed)
Patch Set: Closure compiler fix. Created 4 years 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/test/data/webui/settings/fake_quick_unlock_uma.js
diff --git a/chrome/test/data/webui/settings/fake_quick_unlock_uma.js b/chrome/test/data/webui/settings/fake_quick_unlock_uma.js
new file mode 100644
index 0000000000000000000000000000000000000000..a472bb484113b1cd514ec1e333b1681640646439
--- /dev/null
+++ b/chrome/test/data/webui/settings/fake_quick_unlock_uma.js
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Fake implementation of chrome histogram recording for testing.
+ */
+cr.define('settings', function() {
+ /**
+ * Fake of the chrome.quickUnlockUma.
+ * @constructor
+ */
+ function FakeQuickUnlockUma() {
+ this.histogram = {};
+ for (var key in LockScreenProgress)
+ this.histogram[LockScreenProgress[key]] = 0;
+ }
+
+ FakeQuickUnlockUma.prototype = {
+ /**
+ * Update the histgoram at |key| by one.
+ * @param {LockScreenProgress} key
+ */
+ recordProgress: function(key) {
+ if (!(key in this.histogram))
+ this.histogram[key] = 0;
+ this.histogram[key]++;
+ },
+
+ /**
+ * Get the value of the uma histogram at |key|.
+ * @param {LockScreenProgress} key
+ * @return {Number}
+ */
+ getHistogramValue: function(key) {
+ return this.histogram[key];
+ }
+ };
+
+ return {FakeQuickUnlockUma: FakeQuickUnlockUma};
+});

Powered by Google App Engine
This is Rietveld 408576698