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

Unified Diff: chrome/test/data/extensions/api_test/webstore_private/accepted.js

Issue 15292011: Prevent duplicate webstore install requests being serviced. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 7 years, 7 months 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/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));
});
}
];
« no previous file with comments | « chrome/common/extensions/api/webstore_private.json ('k') | chrome/test/data/extensions/api_test/webstore_private/common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698