Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/webstore_private/silently_install.html |
| diff --git a/chrome/test/data/extensions/api_test/webstore_private/silently_install.html b/chrome/test/data/extensions/api_test/webstore_private/silently_install.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bad73b103e0057b051be825ef64808b2df776afb |
| --- /dev/null |
| +++ b/chrome/test/data/extensions/api_test/webstore_private/silently_install.html |
| @@ -0,0 +1,71 @@ |
| +<script src="common.js"></script> |
| +<script> |
| + |
| +var extension1 = { |
| + 'id': 'bmfoocgfinpmkmlbjhcbofejhkhlbchk', |
| + 'manifest': |
| + '{\ |
| + "name": "Extension Bundle 1",\ |
| + "version": "1",\ |
| + "permissions": [ "tabs" ]\ |
| + }' |
| +}; |
| + |
| +var extension2 = { |
| + 'id': 'mpneghmdnmaolkljkipbhaienajcflfe', |
| + 'manifest': |
| + '{\ |
| + "name": "Extension Bundle 2",\ |
| + "version": "1",\ |
| + "permissions": ["management", "http://google.com" ],\ |
| + "content_script": [{\ |
| + "matches": [ "http://www.example.com/*" ],\ |
| + "js": [ "content_script.js" ],\ |
| + "run_at": "document_start"\ |
| + }]\ |
| + }' |
| +}; |
| + |
| +var extension3 = { |
| + 'id': 'begfmnajjkbjdgmffnjaojchoncnmngg', |
| + 'manifest': |
| + '{\ |
| + "name": "Bundle App 2",\ |
| + "version": "1",\ |
| + "app": {\ |
| + "urls": [ "http://www.testapp2.com" ],\ |
| + "launch": { "web_url": "http://www.testapp2.com" }\ |
| + }\ |
| + }' |
| +}; |
| + |
| +runTests([ |
| + function invalidID() { |
| + var expectedError = "Invalid id"; |
| + chrome.webstorePrivate.silentlyInstall( |
| + { 'id': 'dladmdjkfniedhfhcfoefgojhgaiaccc', 'manifest': getManifest() }, |
| + callbackFail(expectedError)); |
| + }, |
| + |
| + function successfulInstall() { |
| + chrome.webstorePrivate.silentlyInstall(extension1, callbackPass(function() { |
| + checkItemInstalled( |
| + extension1.id, |
| + callbackPass(function(result) { assertTrue(result); })); |
| + })); |
| + |
| + chrome.webstorePrivate.silentlyInstall(extension2, callbackPass(function() { |
|
Mihai Parparita -not on Chrome
2011/11/02 21:05:09
Perhaps one of these should be nested in the callb
jstritar
2011/11/02 21:20:49
Done.
|
| + checkItemInstalled( |
| + extension2.id, |
| + callbackPass(function(result) { assertTrue(result); })); |
| + })); |
| + |
| + chrome.webstorePrivate.silentlyInstall(extension3, callbackPass(function() { |
| + checkItemInstalled( |
| + extension3.id, |
| + callbackPass(function(result) { assertTrue(result); })); |
| + })); |
| + } |
| +]); |
| + |
| +</script> |