blob: 8007f6f4d9b0251b770f6a08503250cab4de25e5 [file] [log] [blame]
<!DOCTYPE html>
<link rel="chrome-webstore-item">
function runTest(galleryUrl) {
// Link URL has to be generated dynamically in order to include the right
// port number. The ID corresponds to the data in the "extension" directory.
document.getElementsByTagName('link')[0].href =
galleryUrl + '/detail/ecglahbcnmdpdciemllbhojghbkagdje';
try {
function() {},
function() {});
function() {
console.log('Unexpected success');
function(errorMessage, errorCode) {
var success = errorCode == 3; // Install in progress error.
if (!success)
console.log('Unexpected error: ' + errorMessage);
} catch (e) {
// Yuck. We can throw this "already installing" error either from the
// renderer (if we catch the fact that it's already installing early) or
// from the browser. In the first case, it's a thrown error, and in the
// second, it triggers the callback from chrome.webstore.install. And to
// top it off, they're different messages. Unfortunately, it's hard to say
// which, if either, we can change, since someone may be relying on one or
// the other.
// TODO(devlin): Make this less bad somehow.
var success =
e.message == 'A Chrome Web Store installation is already pending.';
if (!success)
console.log('Unexpected exception: ' + e);