| Index: chrome/test/data/extensions/api_test/permissions/optional/background.html
|
| diff --git a/chrome/test/data/extensions/api_test/permissions/optional/background.html b/chrome/test/data/extensions/api_test/permissions/optional/background.html
|
| index 8593ab52ae290b42889a0b3e0c74834577cf3685..825b30629a603e007217934b8661f9b2ae15d8f6 100644
|
| --- a/chrome/test/data/extensions/api_test/permissions/optional/background.html
|
| +++ b/chrome/test/data/extensions/api_test/permissions/optional/background.html
|
| @@ -276,6 +276,36 @@ chrome.test.getConfig(function(config) {
|
| pass(function(result) { assertFalse(result); }));
|
| doReq('http://c.com', pass(function(result) { assertFalse(result); }));
|
| }));
|
| + },
|
| +
|
| + // Tests that the changed permissions have taken effect from inside the
|
| + // onAdded and onRemoved event listeners.
|
| + function eventListenerPermissions() {
|
| + listenOnce(chrome.experimental.permissions.onAdded,
|
| + function(permissions) {
|
| + chrome.windows.getAll({populate: true}, pass(function() {
|
| + assertTrue(true);
|
| + }));
|
| + });
|
| + listenOnce(chrome.experimental.permissions.onRemoved,
|
| + function(permissions) {
|
| + try {
|
| + chrome.windows.getAll({populate: true}, function() {
|
| + chrome.test.fail("Should not have tabs API permission.");
|
| + });
|
| + } catch (e) {
|
| + assertTrue(e.message.indexOf(NO_TABS_PERMISSION) == 0);
|
| + }
|
| + });
|
| +
|
| + chrome.experimental.permissions.request(
|
| + {permissions: ['tabs']}, pass(function(granted) {
|
| + assertTrue(granted);
|
| + chrome.experimental.permissions.remove(
|
| + {permissions: ['tabs']}, pass(function() {
|
| + assertTrue(true);
|
| + }));
|
| + }));
|
| }
|
|
|
| ]);
|
|
|