blob: 503d836a53e686adf2d73b88d61c1ba233d63f41 [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 not be initiated from fullscreen') != -1 &&
errorCode == 'notPermitted') {
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>