OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // RLZ api test | 5 // RLZ api test |
6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Rlz | 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.Rlz |
7 | 7 |
8 // If this code changes, then the corresponding code in extension_rlz_apitest.cc | 8 // If this code changes, then the corresponding code in extension_rlz_apitest.cc |
9 // also needs to change. | 9 // also needs to change. |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 function getAccessPointRlz() { | 100 function getAccessPointRlz() { |
101 // Using an access point different then those used above so that if the | 101 // Using an access point different then those used above so that if the |
102 // clearProductState() test runs before this one it does not clear the | 102 // clearProductState() test runs before this one it does not clear the |
103 // rlz string tested for here. | 103 // rlz string tested for here. |
104 chrome.experimental.rlz.getAccessPointRlz('D1', function(rlzString) { | 104 chrome.experimental.rlz.getAccessPointRlz('D1', function(rlzString) { |
105 chrome.test.assertEq('rlz_apitest', rlzString); | 105 chrome.test.assertEq('rlz_apitest', rlzString); |
106 chrome.test.succeed(); | 106 chrome.test.succeed(); |
107 }); | 107 }); |
108 }, | 108 }, |
| 109 |
| 110 function sendFinancialPing() { |
| 111 // Bad product. |
| 112 try { |
| 113 chrome.experimental.rlz.sendFinancialPing('', ['D3'], 'sig', 'TEST', |
| 114 'id', 'en', false); |
| 115 // Should not reach this line since the above call throws. |
| 116 chrome.test.fail(); |
| 117 } catch(ex) { |
| 118 } |
| 119 |
| 120 // Bad access point list. |
| 121 try { |
| 122 chrome.experimental.rlz.sendFinancialPing('D', null, 'sig', 'TEST', |
| 123 'id', 'en', false); |
| 124 // Should not reach this line since the above call throws. |
| 125 chrome.test.fail(); |
| 126 } catch(ex) { |
| 127 } |
| 128 |
| 129 // Bad access point list. |
| 130 try { |
| 131 chrome.experimental.rlz.sendFinancialPing('D', [], 'sig', 'TEST', |
| 132 'id', 'en', false); |
| 133 // Should not reach this line since the above call throws. |
| 134 chrome.test.fail(); |
| 135 } catch(ex) { |
| 136 } |
| 137 |
| 138 // Valid call. |
| 139 chrome.experimental.rlz.sendFinancialPing('D', ['D3'], 'sig', 'TEST', |
| 140 'id', 'en', false); |
| 141 |
| 142 chrome.test.succeed(); |
| 143 } |
109 ]); | 144 ]); |
110 | 145 |
OLD | NEW |