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

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

Issue 141393002: Return a NULL histogram pointer on construction error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, git cl format Created 6 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
« no previous file with comments | « chrome/renderer/pepper/pepper_uma_host.cc ('k') | ppapi/tests/test_uma.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 function getVariationParams2() { 86 function getVariationParams2() {
87 chrome.metricsPrivate.getVariationParams( 87 chrome.metricsPrivate.getVariationParams(
88 'apitestfieldtrial2', function(params) { 88 'apitestfieldtrial2', function(params) {
89 chrome.test.assertEq(undefined, chrome.runtime.lastError); 89 chrome.test.assertEq(undefined, chrome.runtime.lastError);
90 chrome.test.assertEq({a: 'aa', b: 'bb'}, params); 90 chrome.test.assertEq({a: 'aa', b: 'bb'}, params);
91 chrome.test.succeed(); 91 chrome.test.succeed();
92 }); 92 });
93 }, 93 },
94 94
95 function testBucketSizeChanges() {
96 var linear1 = {
97 'metricName': 'test.bucketchange.linear',
98 'type': 'histogram-linear',
99 'min': 0,
100 'max': 100,
101 'buckets': 10
102 };
103 var linear2 = {
104 'metricName': 'test.bucketchange.linear',
105 'type': 'histogram-linear',
106 'min': 0,
107 'max': 100,
108 'buckets': 20
109 };
110 var log1 = {
111 'metricName': 'test.bucketchange.log',
112 'type': 'histogram-log',
113 'min': 0,
114 'max': 100,
115 'buckets': 10
116 };
117 var log2 = {
118 'metricName': 'test.bucketchange.log',
119 'type': 'histogram-log',
120 'min': 0,
121 'max': 100,
122 'buckets': 20
123 };
124
125 chrome.metricsPrivate.recordValue(linear1, 42);
126 // This one should be rejected because the bucket count is different.
127 // We check for sample count == 2 in metrics_apitest.cc
128 chrome.metricsPrivate.recordValue(linear2, 42);
129 chrome.metricsPrivate.recordValue(linear1, 42);
130
131 chrome.metricsPrivate.recordValue(log1, 42);
132 // This one should be rejected because the bucket count is different.
133 // We check for sample count == 2 in metrics_apitest.cc
134 chrome.metricsPrivate.recordValue(log2, 42);
135 chrome.metricsPrivate.recordValue(log1, 42);
136
137 chrome.test.succeed();
138 },
139
95 ]); 140 ]);
96 141
OLDNEW
« no previous file with comments | « chrome/renderer/pepper/pepper_uma_host.cc ('k') | ppapi/tests/test_uma.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698