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

Side by Side Diff: chrome/test/data/extensions/api_test/webstore_private/common.js

Issue 6992047: Change the web store private install API to accept a localized extension name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased, removed test files I added in separate CL Created 9 years, 6 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // The id of the extension we're using for install tests. 5 // The id of the extension we're using for install tests.
6 var extensionId = "enfkhcelefdadlmkffamgdlgplcionje"; 6 var extensionId = "enfkhcelefdadlmkffamgdlgplcionje";
7 7
8 var assertEq = chrome.test.assertEq; 8 var assertEq = chrome.test.assertEq;
9 var assertNoLastError = chrome.test.assertNoLastError; 9 var assertNoLastError = chrome.test.assertNoLastError;
10 var callbackFail = chrome.test.callbackFail; 10 var callbackFail = chrome.test.callbackFail;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Strip the data url prefix to just get the base64-encoded bytes. 42 // Strip the data url prefix to just get the base64-encoded bytes.
43 cachedIcon = tmp.slice(tmp.search(",")+1); 43 cachedIcon = tmp.slice(tmp.search(",")+1);
44 callback(cachedIcon); 44 callback(cachedIcon);
45 }; 45 };
46 img.src = "extension/icon.png"; 46 img.src = "extension/icon.png";
47 } 47 }
48 48
49 var cachedManifest = null; 49 var cachedManifest = null;
50 50
51 // This returns the string contents of the extension's manifest file. 51 // This returns the string contents of the extension's manifest file.
52 function getManifest() { 52 function getManifest(alternativePath) {
53 if (cachedManifest) 53 if (cachedManifest)
54 return cachedManifest; 54 return cachedManifest;
55 55
56 // Do a synchronous XHR to get the manifest. 56 // Do a synchronous XHR to get the manifest.
57 var xhr = new XMLHttpRequest(); 57 var xhr = new XMLHttpRequest();
58 xhr.open("GET", "extension/manifest.json", false); 58 xhr.open("GET",
59 alternativePath ? alternativePath : "extension/manifest.json",
60 false);
59 xhr.send(null); 61 xhr.send(null);
60 return xhr.responseText; 62 return xhr.responseText;
61 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698