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

Unified Diff: chrome/test/data/extensions/api_test/webstore_private/common.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/common.js
diff --git a/chrome/test/data/extensions/api_test/webstore_private/common.js b/chrome/test/data/extensions/api_test/webstore_private/common.js
index bc0805ab11188de71b7caca73589913e46e88fcd..1021877fc0b07b00dca55cc80524ef1d4da4e2f3 100644
--- a/chrome/test/data/extensions/api_test/webstore_private/common.js
+++ b/chrome/test/data/extensions/api_test/webstore_private/common.js
@@ -41,6 +41,7 @@ var img = null;
function getIconData(callback) {
if (cachedIcon) {
callback(cachedIcon);
+ return;
}
var canvas = document.createElement("canvas");
canvas.style.display = "none";
@@ -69,3 +70,27 @@ function getManifest(alternativePath) {
xhr.send(null);
return xhr.responseText;
}
+
+// Installs the extension with the given |installOptions|, calls
+// |whileInstalled| and then uninstalls the extension.
+function installAndCleanUp(installOptions, whileInstalled) {
+ // Begin installing.
+ chrome.webstorePrivate.beginInstallWithManifest3(
+ installOptions,
+ callbackPass(function(result) {
+ assertNoLastError();
+ assertEq("", result);
+
+ // Now complete the installation.
+ chrome.webstorePrivate.completeInstall(
+ extensionId,
+ callbackPass(function(result) {
+ assertNoLastError();
+ assertEq(undefined, result);
+
+ whileInstalled();
+
+ chrome.management.uninstall(extensionId, {}, callbackPass());
+ }));
+ }));
+}

Powered by Google App Engine
This is Rietveld 408576698