Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3838)

Unified Diff: chrome/test/data/extensions/api_test/webstore_private/silently_install.html

Issue 8430033: Adds a webstorePrivate method for silently installing extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove dcheck Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698