blob: 409583287875b903b98a8952bcbc8f11f9c2f27e [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<link rel="chrome-webstore-item">
</head>
<body>
<script>
console.log('Page loaded');
function runTest(galleryUrl) {
console.log('In runTest');
// 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 {
chrome.webstore.install(
undefined,
function() {
console.log('did not expect install success');
window.domAutomationController.send(false);
},
function(error, errorCode) {
if (error.indexOf('can only be modified by the manager') != -1 &&
errorCode == 'otherError') {
console.log('Ran test, sending response');
window.domAutomationController.send(true);
console.log('Test complete');
} else {
console.log('Unexpected error: ' + error);
window.domAutomationController.send(false);
}
});
} catch (e) {
console.log('Unexpected exception: ' + e);
window.domAutomationController.send(false);
throw e;
}
}
</script>
</body>
</html>