Index: chrome/test/data/extensions/api_test/webstore_private/accepted.js |
diff --git a/chrome/test/data/extensions/api_test/webstore_private/accepted.js b/chrome/test/data/extensions/api_test/webstore_private/accepted.js |
index 1eea8b65fe98bab74a17cab90f126e43bb2488f9..780d3f33ae5462cb70399580c746b5fa1ca7ca88 100644 |
--- a/chrome/test/data/extensions/api_test/webstore_private/accepted.js |
+++ b/chrome/test/data/extensions/api_test/webstore_private/accepted.js |
@@ -40,17 +40,35 @@ var tests = [ |
var manifest = getManifest(); |
getIconData(function(icon) { |
+ installAndCleanUp( |
+ {'id': extensionId, 'iconData': icon, 'manifest': manifest}, |
+ function() {}); |
+ }); |
+ }, |
- // Begin installing. |
- chrome.webstorePrivate.beginInstallWithManifest3( |
- {'id': extensionId,'iconData': icon, 'manifest': manifest }, |
- function(result) { |
- assertNoLastError(); |
- assertEq(result, ""); |
+ function duplicateInstall() { |
+ // See things through all the way to a successful install. |
+ listenOnce(chrome.management.onInstalled, function(info) { |
+ assertEq(info.id, extensionId); |
+ }); |
+ |
+ var manifest = getManifest(); |
+ getIconData(function(icon) { |
+ installAndCleanUp( |
+ {'id': extensionId, 'iconData': icon, 'manifest': manifest}, |
+ function() { |
+ // Kick off a serial second install. This should fail. |
+ var expectedError = "This item is already installed"; |
+ chrome.webstorePrivate.beginInstallWithManifest3( |
+ {'id': extensionId, 'iconData': icon, 'manifest': manifest}, |
+ callbackFail(expectedError)); |
+ }); |
- // Now complete the installation. |
- chrome.webstorePrivate.completeInstall(extensionId, callbackPass()); |
- }); |
+ // Kick off a simultaneous second install. This should fail. |
+ var expectedError = "This item is already installed"; |
+ chrome.webstorePrivate.beginInstallWithManifest3( |
+ {'id': extensionId, 'iconData': icon, 'manifest': manifest}, |
+ callbackFail(expectedError)); |
}); |
} |
]; |