OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 extension_metrics_apitest.cc. | 10 // See metrics_apitest.cc. |
11 chrome.test.runTests([ | 11 chrome.test.runTests([ |
12 function recordUserAction() { | 12 function recordUserAction() { |
13 // Log a metric once. | 13 // Log a metric once. |
14 chrome.metricsPrivate.recordUserAction('test.ua.1'); | 14 chrome.metricsPrivate.recordUserAction('test.ua.1'); |
15 | 15 |
16 // Log a metric more than once. | 16 // Log a metric more than once. |
17 chrome.metricsPrivate.recordUserAction('test.ua.2'); | 17 chrome.metricsPrivate.recordUserAction('test.ua.2'); |
18 chrome.metricsPrivate.recordUserAction('test.ua.2'); | 18 chrome.metricsPrivate.recordUserAction('test.ua.2'); |
19 | 19 |
20 chrome.test.succeed(); | 20 chrome.test.succeed(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 function recordCounts() { | 54 function recordCounts() { |
55 chrome.metricsPrivate.recordCount('test.count', 420000); | 55 chrome.metricsPrivate.recordCount('test.count', 420000); |
56 chrome.metricsPrivate.recordMediumCount('test.medium.count', 4200); | 56 chrome.metricsPrivate.recordMediumCount('test.medium.count', 4200); |
57 chrome.metricsPrivate.recordSmallCount('test.small.count', 42); | 57 chrome.metricsPrivate.recordSmallCount('test.small.count', 42); |
58 | 58 |
59 chrome.test.succeed(); | 59 chrome.test.succeed(); |
60 } | 60 } |
61 ]); | 61 ]); |
62 | 62 |
OLD | NEW |