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

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

Issue 7735001: Add a iconUrl parameter to webstorePrivate.beginInstallWithManifest2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 9 years, 4 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
« no previous file with comments | « chrome/test/data/extensions/api_test/webstore_private/icon_url.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/webstore_private/icon_url.js
diff --git a/chrome/test/data/extensions/api_test/webstore_private/icon_url.js b/chrome/test/data/extensions/api_test/webstore_private/icon_url.js
new file mode 100644
index 0000000000000000000000000000000000000000..e87a1a9b83ff346ce5b89f68746125a2d30e59c0
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webstore_private/icon_url.js
@@ -0,0 +1,40 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function makeAbsoluteUrl(path) {
+ var parts = location.href.split("/");
+ parts.pop();
+ parts.push(path);
+ return parts.join("/");
+}
+
+var tests = [
+ function IconUrlFailure() {
+ var manifest = getManifest();
+ var loadFailureUrl = makeAbsoluteUrl("does_not_exist.png");
+ chrome.webstorePrivate.beginInstallWithManifest2(
+ {'id': extensionId,'iconUrl': loadFailureUrl, 'manifest': manifest },
+ callbackFail("Image decode failed", function(result) {
+ assertEq(result, "icon_error");
+ }));
+ },
+
+ function IconUrlSuccess() {
+ var manifest = getManifest();
+
+ // The |absoluteIconUrl| parameter controls whether to use a relative or
+ // absolute url for the test.
+ function runSuccessTest(absoluteIconUrl) {
+ var iconPath = "extension/icon.png";
+ var iconUrl = absoluteIconUrl ? makeAbsoluteUrl(iconPath) : iconPath;
+ chrome.webstorePrivate.beginInstallWithManifest2(
+ {'id': extensionId,'iconUrl': iconUrl, 'manifest': manifest },
+ callbackPass());
+ }
+ runSuccessTest(true);
+ runSuccessTest(false);
+ }
+];
+
+runTests(tests);
« no previous file with comments | « chrome/test/data/extensions/api_test/webstore_private/icon_url.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698