Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/developer/test/basics.js |
| diff --git a/chrome/test/data/extensions/api_test/developer/test/basics.js b/chrome/test/data/extensions/api_test/developer/test/basics.js |
| index 046b6b6b4aec865ef1aa6ca0a72be6ac41eac254..4f631ad5b34383dc2281ca80270e8aa169e85452 100644 |
| --- a/chrome/test/data/extensions/api_test/developer/test/basics.js |
| +++ b/chrome/test/data/extensions/api_test/developer/test/basics.js |
| @@ -22,6 +22,46 @@ var tests = [ |
| checkItemInList(items, "packaged_app", true, "packaged_app", |
| { "offline_enabled": true}); |
| })); |
| + }, |
| + function aliasedFunctions() { |
| + // The allow file access and allow incognito functions are aliased with |
| + // custom bindings. Test that they work as expected. |
| + var getExtensionInfoCallback = chrome.test.callbackAdded(); |
| + chrome.developerPrivate.getExtensionsInfo(function(infos) { |
| + var info = null; |
| + for (var i = 0; i < infos.length; ++i) { |
| + if (infos[i].name == 'simple_extension') { |
| + info = infos[i]; |
| + break; |
| + } |
| + } |
| + var extId = info.id; |
| + chrome.test.assertTrue(info != null); |
|
Dan Beam
2015/03/18 19:12:49
^ shouldn't you do this before accessing info.id?
Devlin
2015/03/18 22:20:28
Yes. Done.
|
| + chrome.test.assertFalse(info.incognitoAccess.isActive); |
| + chrome.test.assertTrue(info.fileAccess.isActive); |
| + chrome.test.assertEq(chrome.developerPrivate.ExtensionState.ENABLED, |
| + info.state); |
| + var allowIncognitoCallback = chrome.test.callbackAdded(); |
| + chrome.test.runWithUserGesture(function() { |
| + chrome.developerPrivate.allowIncognito(extId, true, function() { |
| + chrome.developerPrivate.getExtensionInfo(extId, function(info) { |
| + chrome.test.assertTrue(info.incognitoAccess.isActive); |
| + allowIncognitoCallback(); |
| + }); |
| + }); |
| + }); |
| + var allowFileAccessCallback = chrome.test.callbackAdded(); |
| + chrome.test.runWithUserGesture(function() { |
| + chrome.developerPrivate.allowFileAccess(extId, false, function() { |
| + chrome.developerPrivate.getExtensionInfo(extId, function(info) { |
| + chrome.test.assertFalse(info.fileAccess.isActive); |
| + allowFileAccessCallback(); |
| + }); |
| + }); |
| + }); |
| + |
| + getExtensionInfoCallback(); |
|
Dan Beam
2015/03/18 19:12:49
nit: Promises?
Devlin
2015/03/18 22:20:28
I've tried rewriting it a few ways, and, frankly,
Dan Beam
2015/03/18 22:38:13
don't worry about it
|
| + }); |
| } |
| ]; |