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

Unified Diff: chrome/test/data/extensions/api_test/metrics/test.js

Issue 657037: Add a metrics extensions API.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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/test/data/extensions/api_test/metrics/test.js
===================================================================
--- chrome/test/data/extensions/api_test/metrics/test.js (revision 0)
+++ chrome/test/data/extensions/api_test/metrics/test.js (revision 0)
@@ -0,0 +1,62 @@
+// Copyright (c) 2010 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.
+
+// metrics api test
+// browser_tests.exe --gtest_filter=ExtensionApiTest.Metrics
+
+// Any changes to the logging done in these functions should be matched
+// with the checks done in IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Metrics).
+// See extension_metrics_apitest.cc.
+chrome.test.runTests([
+ function recordUserAction() {
+ // Log a metric once.
+ chrome.metrics.recordUserAction('test.ua.1');
+
+ // Log a metric more than once.
+ chrome.metrics.recordUserAction('test.ua.2');
+ chrome.metrics.recordUserAction('test.ua.2');
+
+ chrome.test.succeed();
+ },
+
+ function recordValue() {
+ chrome.metrics.recordValue({
+ 'metricName': 'test.h.1',
+ 'type': 'histogram-log',
+ 'min': 1,
+ 'max': 100,
+ 'buckets': 50
+ }, 42);
+
+ chrome.metrics.recordValue({
+ 'metricName': 'test.h.2',
+ 'type': 'histogram-linear',
+ 'min': 1,
+ 'max': 200,
+ 'buckets': 50
+ }, 42);
+
+ chrome.metrics.recordPercentage('test.h.3', 42);
+ chrome.metrics.recordPercentage('test.h.3', 42);
+
+ chrome.test.succeed();
+ },
+
+ function recordTimes() {
+ chrome.metrics.recordTime('test.time', 42);
+ chrome.metrics.recordMediumTime('test.medium.time', 42 * 1000);
+ chrome.metrics.recordLongTime('test.long.time', 42 * 1000 * 60);
+
+ chrome.test.succeed();
+ },
+
+ function recordCounts() {
+ chrome.metrics.recordCount('test.count', 420000);
+ chrome.metrics.recordMediumCount('test.medium.count', 4200);
+ chrome.metrics.recordSmallCount('test.small.count', 42);
+
+ chrome.test.succeed();
+ }
+]);
+
Property changes on: chrome\test\data\extensions\api_test\metrics\test.js
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/test/data/extensions/api_test/metrics/test.html ('k') | chrome/test/test_launcher/out_of_proc_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698