Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <script> | |
| 2 | |
| 3 var assertFalse = chrome.test.assertFalse; | |
| 4 var assertTrue = chrome.test.assertTrue; | |
| 5 var pass = chrome.test.callbackPass; | |
| 6 | |
| 7 var NO_TABS_PERMISSION = | |
| 8 "You do not have permission to use 'windows.getAll'."; | |
| 9 | |
| 10 chrome.test.runTests([ | |
| 11 function denyRequest() { | |
| 12 chrome.permissions.request({apis: ['tabs']}, pass(function(granted) { | |
| 13 // They were not granted, and there should be no error. | |
| 14 assertFalse(granted); | |
| 15 assertTrue(chrome.extension.lastError === undefined); | |
| 16 | |
| 17 // Make sure they weren't granted... | |
| 18 chrome.permissions.contains({apis: ['tabs']}, pass(function(result) { | |
| 19 assertFalse(result); | |
| 20 })); | |
| 21 | |
| 22 try { | |
| 23 chrome.windows.getAll({populate: true}, function() { | |
| 24 assertTrue(false); | |
|
Mihai Parparita -not on Chrome
2011/07/20 22:03:43
Ditto about using chrome.test.fail("Should not hav
jstritar
2011/07/22 19:21:55
Done.
| |
| 25 }); | |
| 26 } catch (e) { | |
| 27 assertTrue(e.message.indexOf(NO_TABS_PERMISSION) == 0); | |
| 28 } | |
| 29 })); | |
| 30 } | |
| 31 ]); | |
| 32 </script> | |
| OLD | NEW |