OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // metrics api test | 5 // metrics api test |
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Metrics | 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Metrics |
7 | 7 |
8 // Any changes to the logging done in these functions should be matched | 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). | 9 // with the checks done in IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Metrics). |
10 // See metrics_apitest.cc. | 10 // See metrics_apitest.cc. |
(...skipping 25 matching lines...) Expand all Loading... |
36 'max': 200, | 36 'max': 200, |
37 'buckets': 50 | 37 'buckets': 50 |
38 }, 42); | 38 }, 42); |
39 | 39 |
40 chrome.metricsPrivate.recordPercentage('test.h.3', 42); | 40 chrome.metricsPrivate.recordPercentage('test.h.3', 42); |
41 chrome.metricsPrivate.recordPercentage('test.h.3', 42); | 41 chrome.metricsPrivate.recordPercentage('test.h.3', 42); |
42 | 42 |
43 chrome.test.succeed(); | 43 chrome.test.succeed(); |
44 }, | 44 }, |
45 | 45 |
| 46 function recordSparseValue() { |
| 47 chrome.metricsPrivate.recordSparseValue('test.sparse.1', 42); |
| 48 chrome.metricsPrivate.recordSparseValue('test.sparse.2', 24); |
| 49 chrome.metricsPrivate.recordSparseValue('test.sparse.2', 24); |
| 50 chrome.metricsPrivate.recordSparseValue('test.sparse.3', 1); |
| 51 chrome.metricsPrivate.recordSparseValue('test.sparse.3', 2); |
| 52 chrome.metricsPrivate.recordSparseValue('test.sparse.3', 2); |
| 53 chrome.metricsPrivate.recordSparseValue('test.sparse.3', 3); |
| 54 chrome.metricsPrivate.recordSparseValue('test.sparse.3', 3); |
| 55 chrome.metricsPrivate.recordSparseValue('test.sparse.3', 3); |
| 56 |
| 57 chrome.test.succeed(); |
| 58 }, |
| 59 |
46 function recordTimes() { | 60 function recordTimes() { |
47 chrome.metricsPrivate.recordTime('test.time', 42); | 61 chrome.metricsPrivate.recordTime('test.time', 42); |
48 chrome.metricsPrivate.recordMediumTime('test.medium.time', 42 * 1000); | 62 chrome.metricsPrivate.recordMediumTime('test.medium.time', 42 * 1000); |
49 chrome.metricsPrivate.recordLongTime('test.long.time', 42 * 1000 * 60); | 63 chrome.metricsPrivate.recordLongTime('test.long.time', 42 * 1000 * 60); |
50 | 64 |
51 chrome.test.succeed(); | 65 chrome.test.succeed(); |
52 }, | 66 }, |
53 | 67 |
54 function recordCounts() { | 68 function recordCounts() { |
55 chrome.metricsPrivate.recordCount('test.count', 420000); | 69 chrome.metricsPrivate.recordCount('test.count', 420000); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // This one should be rejected because the bucket count is different. | 146 // This one should be rejected because the bucket count is different. |
133 // We check for sample count == 2 in metrics_apitest.cc | 147 // We check for sample count == 2 in metrics_apitest.cc |
134 chrome.metricsPrivate.recordValue(log2, 42); | 148 chrome.metricsPrivate.recordValue(log2, 42); |
135 chrome.metricsPrivate.recordValue(log1, 42); | 149 chrome.metricsPrivate.recordValue(log1, 42); |
136 | 150 |
137 chrome.test.succeed(); | 151 chrome.test.succeed(); |
138 }, | 152 }, |
139 | 153 |
140 ]); | 154 ]); |
141 | 155 |
OLD | NEW |