diff options
9 files changed, 45 insertions, 104 deletions
diff --git a/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.cc b/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.cc index 2bb5d6d..887bec7 100644 --- a/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.cc +++ b/chrome/browser/extensions/api/dashboard_private/dashboard_private_api.cc @@ -27,8 +27,6 @@ namespace { // Error messages that can be returned by the API. const char kAlreadyInstalledError[] = "This item is already installed"; -const char kCannotSpecifyIconDataAndUrlError[] = - "You cannot specify both icon data and an icon url"; const char kInvalidBundleError[] = "Invalid bundle"; const char kInvalidIconUrlError[] = "Invalid icon url"; const char kInvalidIdError[] = "Invalid id"; @@ -69,11 +67,6 @@ DashboardPrivateShowPermissionPromptForDelegatedInstallFunction::Run() { kInvalidIdError)); } - if (params_->details.icon_data && params_->details.icon_url) { - return RespondNow(BuildResponse(api::dashboard_private::RESULT_ICON_ERROR, - kCannotSpecifyIconDataAndUrlError)); - } - GURL icon_url; if (params_->details.icon_url) { icon_url = source_url().Resolve(*params_->details.icon_url); diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc index 7ee73f4..bdb58ca 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc @@ -125,8 +125,6 @@ const char kWebstoreLogin[] = "extensions.webstore_login"; // Error messages that can be returned by the API. const char kAlreadyInstalledError[] = "This item is already installed"; -const char kCannotSpecifyIconDataAndUrlError[] = - "You cannot specify both icon data and an icon url"; const char kInvalidBundleError[] = "Invalid bundle"; const char kInvalidIconUrlError[] = "Invalid icon url"; const char kInvalidIdError[] = "Invalid id"; @@ -193,11 +191,6 @@ WebstorePrivateBeginInstallWithManifest3Function::Run() { kInvalidIdError)); } - if (details().icon_data && details().icon_url) { - return RespondNow(BuildResponse(api::webstore_private::RESULT_ICON_ERROR, - kCannotSpecifyIconDataAndUrlError)); - } - GURL icon_url; if (details().icon_url) { icon_url = source_url().Resolve(*details().icon_url); diff --git a/chrome/common/extensions/api/dashboard_private.json b/chrome/common/extensions/api/dashboard_private.json index a488ef5..30e9e24 100644 --- a/chrome/common/extensions/api/dashboard_private.json +++ b/chrome/common/extensions/api/dashboard_private.json @@ -67,11 +67,6 @@ "optional": true, "desciption": "A URL for the image to display in the confirmation dialog" }, - "iconData": { - "type": "string", - "optional": true, - "description": "An icon as a base64-encoded image, displayed in a confirmation dialog." - }, "localizedName": { "type": "string", "optional": true, diff --git a/chrome/common/extensions/api/webstore_private.json b/chrome/common/extensions/api/webstore_private.json index a24198e..65e4b10 100644 --- a/chrome/common/extensions/api/webstore_private.json +++ b/chrome/common/extensions/api/webstore_private.json @@ -116,11 +116,6 @@ "optional": true, "desciption": "A URL for the image to display in the confirmation dialog" }, - "iconData": { - "type": "string", - "optional": true, - "description": "An icon as a base64-encoded image, displayed in a confirmation dialog." - }, "localizedName": { "type": "string", "optional": true, 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 780d3f3..5e88b19 100644 --- a/chrome/test/data/extensions/api_test/webstore_private/accepted.js +++ b/chrome/test/data/extensions/api_test/webstore_private/accepted.js @@ -39,11 +39,11 @@ var tests = [ }); var manifest = getManifest(); - getIconData(function(icon) { - installAndCleanUp( - {'id': extensionId, 'iconData': icon, 'manifest': manifest}, - function() {}); - }); + installAndCleanUp( + {'id': extensionId, 'iconUrl': 'extension/icon.png', + 'manifest': manifest}, + function() {} + ); }, function duplicateInstall() { @@ -53,23 +53,22 @@ var tests = [ }); 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)); - }); + iconUrl = 'extension/icon.png'; + installAndCleanUp( + {'id': extensionId, 'iconUrl': iconUrl, 'manifest': manifest}, + function() { + // Kick off a serial second install. This should fail. + var expectedError = "This item is already installed"; + chrome.webstorePrivate.beginInstallWithManifest3( + {'id': extensionId, 'iconUrl': iconUrl, 'manifest': manifest}, + callbackFail(expectedError)); + }); - // 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)); - }); + // Kick off a simultaneous second install. This should fail. + var expectedError = "This item is already installed"; + chrome.webstorePrivate.beginInstallWithManifest3( + {'id': extensionId, 'iconUrl': iconUrl, 'manifest': manifest}, + callbackFail(expectedError)); } ]; diff --git a/chrome/test/data/extensions/api_test/webstore_private/cancelled.html b/chrome/test/data/extensions/api_test/webstore_private/cancelled.html index 643b93f..2e54095 100644 --- a/chrome/test/data/extensions/api_test/webstore_private/cancelled.html +++ b/chrome/test/data/extensions/api_test/webstore_private/cancelled.html @@ -4,14 +4,11 @@ // beginInstallWithManifest3. var manifest = getManifest(); -getIconData(function(icon) { - - // Begin installing. - chrome.webstorePrivate.beginInstallWithManifest3( - {'id':extensionId, 'iconData': icon, 'manifest': manifest}, - function(result) { - assertEq(result, "user_cancelled"); - succeed(); - }); -}); +// Begin installing. +chrome.webstorePrivate.beginInstallWithManifest3( + {'id':extensionId, 'manifest': manifest}, + function(result) { + assertEq(result, "user_cancelled"); + succeed(); + }); </script> 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 7aa92fd..d54ac8f 100644 --- a/chrome/test/data/extensions/api_test/webstore_private/common.js +++ b/chrome/test/data/extensions/api_test/webstore_private/common.js @@ -34,32 +34,6 @@ function checkInstalled(callback) { checkItemInstalled(extensionId, callback); } -var cachedIcon = null; -var img = null; - -// This returns the base64-encoded content of the extension's image. -function getIconData(callback) { - if (cachedIcon) { - callback(cachedIcon); - return; - } - var canvas = document.createElement("canvas"); - canvas.style.display = "none"; - canvas.width = 128; - canvas.height = 128; - img = new Image(); - img.onload = function() { - console.log('img.onload called'); - var ctx = canvas.getContext("2d"); - ctx.drawImage(img, 0, 0); - var tmp = canvas.toDataURL(); - // Strip the data url prefix to just get the base64-encoded bytes. - cachedIcon = tmp.slice(tmp.search(",")+1); - callback(cachedIcon); - }; - img.src = "extension/icon.png"; -} - // This returns the string contents of the extension's manifest file. function getManifest(alternativePath) { // Do a synchronous XHR to get the manifest. diff --git a/chrome/test/data/extensions/api_test/webstore_private/empty.js b/chrome/test/data/extensions/api_test/webstore_private/empty.js index 5d02b75..9680253 100644 --- a/chrome/test/data/extensions/api_test/webstore_private/empty.js +++ b/chrome/test/data/extensions/api_test/webstore_private/empty.js @@ -3,18 +3,15 @@ // found in the LICENSE file. var manifest = getManifest(); -getIconData(function(icon) { +// Begin installing. +chrome.webstorePrivate.beginInstallWithManifest3( + {'id': extensionId, 'manifest': manifest}, + function(result) { + assertNoLastError(); + assertEq(result, ""); - // Begin installing. - chrome.webstorePrivate.beginInstallWithManifest3( - {'id': extensionId,'iconData': icon, 'manifest': manifest }, - function(result) { - assertNoLastError(); - assertEq(result, ""); - - // Now complete the installation. - var expectedError = "Package is invalid: 'CRX_HEADER_INVALID'."; - chrome.webstorePrivate.completeInstall(extensionId, - callbackFail(expectedError)); - }); + // Now complete the installation. + var expectedError = "Package is invalid: 'CRX_HEADER_INVALID'."; + chrome.webstorePrivate.completeInstall(extensionId, + callbackFail(expectedError)); }); diff --git a/chrome/test/data/extensions/api_test/webstore_private/localized.js b/chrome/test/data/extensions/api_test/webstore_private/localized.js index 2e93e47..69e77ac 100644 --- a/chrome/test/data/extensions/api_test/webstore_private/localized.js +++ b/chrome/test/data/extensions/api_test/webstore_private/localized.js @@ -16,16 +16,14 @@ var tests = [ var manifest = getManifest('localized_extension/manifest.json'); var messages = getManifest('localized_extension/_locales/fr/messages.json'); - getIconData(function(icon) { - // Begin installing. - chrome.webstorePrivate.beginInstallWithManifest3( - { 'id':localizedId, 'iconData': icon, 'manifest': manifest, - 'localizedName': 'Le Title', 'locale': 'fr' }, - callbackPass(function(result) { - assertEq(result, ""); - chrome.webstorePrivate.completeInstall(localizedId, callbackPass()); - })); - }); + // Begin installing. + chrome.webstorePrivate.beginInstallWithManifest3( + { 'id':localizedId, 'manifest': manifest, 'localizedName': 'Le Title', + 'locale': 'fr' }, + callbackPass(function(result) { + assertEq(result, ""); + chrome.webstorePrivate.completeInstall(localizedId, callbackPass()); + })); } ]; |
