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

Side by Side 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, 3 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 function makeAbsoluteUrl(path) {
6 var parts = location.href.split("/");
7 parts.pop();
8 parts.push(path);
9 return parts.join("/");
10 }
11
12 var tests = [
13 function IconUrlFailure() {
14 var manifest = getManifest();
15 var loadFailureUrl = makeAbsoluteUrl("does_not_exist.png");
16 chrome.webstorePrivate.beginInstallWithManifest2(
17 {'id': extensionId,'iconUrl': loadFailureUrl, 'manifest': manifest },
18 callbackFail("Image decode failed", function(result) {
19 assertEq(result, "icon_error");
20 }));
21 },
22
23 function IconUrlSuccess() {
24 var manifest = getManifest();
25
26 // The |absoluteIconUrl| parameter controls whether to use a relative or
27 // absolute url for the test.
28 function runSuccessTest(absoluteIconUrl) {
29 var iconPath = "extension/icon.png";
30 var iconUrl = absoluteIconUrl ? makeAbsoluteUrl(iconPath) : iconPath;
31 chrome.webstorePrivate.beginInstallWithManifest2(
32 {'id': extensionId,'iconUrl': iconUrl, 'manifest': manifest },
33 callbackPass());
34 }
35 runSuccessTest(true);
36 runSuccessTest(false);
37 }
38 ];
39
40 runTests(tests);
OLDNEW
« 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