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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 chrome.test.assertEq('group1', group); | 83 chrome.test.assertEq('group1', group); |
84 chrome.test.succeed(); | 84 chrome.test.succeed(); |
85 }; | 85 }; |
86 | 86 |
87 chrome.metricsPrivate.getFieldTrial('apitestfieldtrial1', test1Callback); | 87 chrome.metricsPrivate.getFieldTrial('apitestfieldtrial1', test1Callback); |
88 }, | 88 }, |
89 | 89 |
90 function getVariationParams1() { | 90 function getVariationParams1() { |
91 chrome.metricsPrivate.getVariationParams( | 91 chrome.metricsPrivate.getVariationParams( |
92 'apitestfieldtrial1', function(params) { | 92 'apitestfieldtrial1', function(params) { |
93 chrome.test.assertEq('Variation parameters are unavailable.', | 93 chrome.test.assertEq(undefined, chrome.runtime.lastError); |
not at google - send to devlin
2014/05/07 15:04:04
Now's use of this function and the test disagree.
| |
94 chrome.runtime.lastError.message); | |
95 chrome.test.assertEq(undefined, params); | 94 chrome.test.assertEq(undefined, params); |
96 chrome.test.succeed(); | 95 chrome.test.succeed(); |
97 }); | 96 }); |
98 }, | 97 }, |
99 | 98 |
100 function getVariationParams2() { | 99 function getVariationParams2() { |
101 chrome.metricsPrivate.getVariationParams( | 100 chrome.metricsPrivate.getVariationParams( |
102 'apitestfieldtrial2', function(params) { | 101 'apitestfieldtrial2', function(params) { |
103 chrome.test.assertEq(undefined, chrome.runtime.lastError); | 102 chrome.test.assertEq(undefined, chrome.runtime.lastError); |
104 chrome.test.assertEq({a: 'aa', b: 'bb'}, params); | 103 chrome.test.assertEq({a: 'aa', b: 'bb'}, params); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 // This one should be rejected because the bucket count is different. | 145 // This one should be rejected because the bucket count is different. |
147 // We check for sample count == 2 in metrics_apitest.cc | 146 // We check for sample count == 2 in metrics_apitest.cc |
148 chrome.metricsPrivate.recordValue(log2, 42); | 147 chrome.metricsPrivate.recordValue(log2, 42); |
149 chrome.metricsPrivate.recordValue(log1, 42); | 148 chrome.metricsPrivate.recordValue(log1, 42); |
150 | 149 |
151 chrome.test.succeed(); | 150 chrome.test.succeed(); |
152 }, | 151 }, |
153 | 152 |
154 ]); | 153 ]); |
155 | 154 |
OLD | NEW |