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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 chrome.test.assertEq('', group); | 64 chrome.test.assertEq('', group); |
65 chrome.metricsPrivate.getFieldTrial('apitestfieldtrial2', test2Callback); | 65 chrome.metricsPrivate.getFieldTrial('apitestfieldtrial2', test2Callback); |
66 }; | 66 }; |
67 | 67 |
68 var test2Callback = function(group) { | 68 var test2Callback = function(group) { |
69 chrome.test.assertEq('group1', group); | 69 chrome.test.assertEq('group1', group); |
70 chrome.test.succeed(); | 70 chrome.test.succeed(); |
71 }; | 71 }; |
72 | 72 |
73 chrome.metricsPrivate.getFieldTrial('apitestfieldtrial1', test1Callback); | 73 chrome.metricsPrivate.getFieldTrial('apitestfieldtrial1', test1Callback); |
74 } | 74 }, |
| 75 |
| 76 function getVariationParams1() { |
| 77 chrome.metricsPrivate.getVariationParams( |
| 78 'apitestfieldtrial1', function(params) { |
| 79 chrome.test.assertEq('Variation parameters are unavailable.', |
| 80 chrome.runtime.lastError.message); |
| 81 chrome.test.assertEq(undefined, params); |
| 82 chrome.test.succeed(); |
| 83 }); |
| 84 }, |
| 85 |
| 86 function getVariationParams2() { |
| 87 chrome.metricsPrivate.getVariationParams( |
| 88 'apitestfieldtrial2', function(params) { |
| 89 chrome.test.assertEq(undefined, chrome.runtime.lastError); |
| 90 chrome.test.assertEq({a: 'aa', b: 'bb'}, params); |
| 91 chrome.test.succeed(); |
| 92 }); |
| 93 }, |
| 94 |
75 ]); | 95 ]); |
76 | 96 |
OLD | NEW |