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

Side by Side Diff: chrome/test/data/extensions/api_test/metrics/test.js

Issue 2331343012: Create MetricsPrivateDelegate for metricsPrivate behavior (Closed)
Patch Set: nit & rebase Created 4 years, 2 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
OLDNEW
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.
11 chrome.test.runTests([ 11 chrome.test.runTests([
12 function getIsCrashReportingEnabled() {
13 chrome.metricsPrivate.getIsCrashReportingEnabled(function(enabled) {
14 chrome.test.assertEq('boolean', typeof enabled);
15 chrome.test.succeed();
16 });
17 },
18
12 function recordUserAction() { 19 function recordUserAction() {
13 // Log a metric once. 20 // Log a metric once.
14 chrome.metricsPrivate.recordUserAction('test.ua.1'); 21 chrome.metricsPrivate.recordUserAction('test.ua.1');
15 22
16 // Log a metric more than once. 23 // Log a metric more than once.
17 chrome.metricsPrivate.recordUserAction('test.ua.2'); 24 chrome.metricsPrivate.recordUserAction('test.ua.2');
18 chrome.metricsPrivate.recordUserAction('test.ua.2'); 25 chrome.metricsPrivate.recordUserAction('test.ua.2');
19 26
20 chrome.test.succeed(); 27 chrome.test.succeed();
21 }, 28 },
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 // This one should be rejected because the bucket count is different. 152 // This one should be rejected because the bucket count is different.
146 // We check for sample count == 2 in metrics_apitest.cc 153 // We check for sample count == 2 in metrics_apitest.cc
147 chrome.metricsPrivate.recordValue(log2, 42); 154 chrome.metricsPrivate.recordValue(log2, 42);
148 chrome.metricsPrivate.recordValue(log1, 42); 155 chrome.metricsPrivate.recordValue(log1, 42);
149 156
150 chrome.test.succeed(); 157 chrome.test.succeed();
151 }, 158 },
152 159
153 ]); 160 ]);
154 161
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_accessor.h ('k') | extensions/browser/api/extensions_api_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698