| OLD | NEW |
| 1 <script> | 1 <script> |
| 2 // Calls chrome.test.succeed after the settings have been cleared for the next | 2 // Calls chrome.test.succeed after the settings have been cleared for the next |
| 3 // test. | 3 // test. |
| 4 function succeed() { | 4 function succeed() { |
| 5 chrome.experimental.settings.clear(chrome.test.succeed); | 5 chrome.experimental.settings.clear(chrome.test.succeed); |
| 6 } | 6 } |
| 7 | 7 |
| 8 chrome.test.runTests([ | 8 chrome.test.runTests([ |
| 9 function getWhenEmpty() { | 9 function getWhenEmpty() { |
| 10 function stage0() { | 10 function stage0() { |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 }, stage8); | 278 }, stage8); |
| 279 } | 279 } |
| 280 function stage8(settings) { | 280 function stage8(settings) { |
| 281 chrome.test.assertEq({ | 281 chrome.test.assertEq({ |
| 282 'foo': 'defaultBar', | 282 'foo': 'defaultBar', |
| 283 'baz': {} | 283 'baz': {} |
| 284 }, settings); | 284 }, settings); |
| 285 succeed(); | 285 succeed(); |
| 286 } | 286 } |
| 287 stage0(); | 287 stage0(); |
| 288 }, |
| 289 |
| 290 function throttling() { |
| 291 // Should get throttled after 1000 calls. |
| 292 var maxRequests = 1001; |
| 293 function next() { |
| 294 chrome.experimental.settings.clear((--maxRequests > 0) ? next : done); |
| 295 } |
| 296 function done() { |
| 297 chrome.test.assertEq( |
| 298 "This request exceeds available quota.", |
| 299 chrome.extension.lastError.message); |
| 300 succeed(); |
| 301 } |
| 302 chrome.experimental.settings.clear(next); |
| 288 } | 303 } |
| 289 ]); | 304 ]); |
| 290 </script> | 305 </script> |
| OLD | NEW |