| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 chrome.experimental.rlz.sendFinancialPing('D', [], 'sig', 'TEST', | 131 chrome.experimental.rlz.sendFinancialPing('D', [], 'sig', 'TEST', |
| 132 'id', 'en', false); | 132 'id', 'en', false); |
| 133 // Should not reach this line since the above call throws. | 133 // Should not reach this line since the above call throws. |
| 134 chrome.test.fail(); | 134 chrome.test.fail(); |
| 135 } catch(ex) { | 135 } catch(ex) { |
| 136 } | 136 } |
| 137 | 137 |
| 138 // Valid call. Should send a ping. | 138 // Valid call. Should send a ping. |
| 139 chrome.experimental.rlz.sendFinancialPing('D', ['D3'], 'sig', 'TEST', | 139 chrome.experimental.rlz.sendFinancialPing('D', ['D3'], 'sig', 'TEST', |
| 140 'id', 'en', false, | 140 'id', 'en', false, |
| 141 function(sent) { | 141 function(sent) { |
| 142 if (sent) { | 142 if (sent) { |
| 143 chrome.test.succeed(); | 143 chrome.test.succeed(); |
| 144 } else { | 144 } else { |
| 145 chrome.test.fail(); | 145 chrome.test.fail(); |
| 146 } | 146 } |
| 147 }); | |
| 148 | 147 |
| 149 // Try another call, this time the ping should not be sent. | 148 // Try another call, this time the ping should not be sent. |
| 150 chrome.experimental.rlz.sendFinancialPing('D', ['D3'], 'sig', 'TEST', | 149 chrome.experimental.rlz.sendFinancialPing('D', ['D3'], 'sig', 'TEST', |
| 151 'id', 'en', false, | 150 'id', 'en', false, |
| 152 function(sent) { | 151 function(sent) { |
| 153 if (sent) { | 152 if (sent) { |
| 154 chrome.test.fail(); | 153 chrome.test.fail(); |
| 155 } else { | 154 } else { |
| 156 chrome.test.succeed(); | 155 chrome.test.succeed(); |
| 157 } | 156 } |
| 158 }); | 157 }); |
| 158 }); |
| 159 | 159 |
| 160 // Valid call. Test that callback does not need to be specified. | 160 // Valid call. Test that callback does not need to be specified. |
| 161 chrome.experimental.rlz.sendFinancialPing('D', ['D3'], 'sig', 'TEST', | 161 chrome.experimental.rlz.sendFinancialPing('D', ['D3'], 'sig', 'TEST', |
| 162 'id', 'en', false); | 162 'id', 'en', false); |
| 163 } | 163 } |
| 164 ]); | 164 ]); |
| OLD | NEW |