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

Side by Side 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, 9 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // metrics api test
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Metrics
7
8 // Any changes to the logging done in these functions should be matched
9 // with the checks done in IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Metrics).
10 // See extension_metrics_apitest.cc.
11 chrome.test.runTests([
12 function recordUserAction() {
13 // Log a metric once.
14 chrome.metrics.recordUserAction('test.ua.1');
15
16 // Log a metric more than once.
17 chrome.metrics.recordUserAction('test.ua.2');
18 chrome.metrics.recordUserAction('test.ua.2');
19
20 chrome.test.succeed();
21 },
22
23 function recordValue() {
24 chrome.metrics.recordValue({
25 'metricName': 'test.h.1',
26 'type': 'histogram-log',
27 'min': 1,
28 'max': 100,
29 'buckets': 50
30 }, 42);
31
32 chrome.metrics.recordValue({
33 'metricName': 'test.h.2',
34 'type': 'histogram-linear',
35 'min': 1,
36 'max': 200,
37 'buckets': 50
38 }, 42);
39
40 chrome.metrics.recordPercentage('test.h.3', 42);
41 chrome.metrics.recordPercentage('test.h.3', 42);
42
43 chrome.test.succeed();
44 },
45
46 function recordTimes() {
47 chrome.metrics.recordTime('test.time', 42);
48 chrome.metrics.recordMediumTime('test.medium.time', 42 * 1000);
49 chrome.metrics.recordLongTime('test.long.time', 42 * 1000 * 60);
50
51 chrome.test.succeed();
52 },
53
54 function recordCounts() {
55 chrome.metrics.recordCount('test.count', 420000);
56 chrome.metrics.recordMediumCount('test.medium.count', 4200);
57 chrome.metrics.recordSmallCount('test.small.count', 42);
58
59 chrome.test.succeed();
60 }
61 ]);
62
OLDNEW
« 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