| <!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/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; |
| |
| try { |
| chrome.webstore.install( |
| undefined, |
| function() { |
| console.log('did not expect install success'); |
| window.domAutomationController.send(false); |
| }, |
| function(error, errorCode) { |
| if (error.indexOf('not supported') != -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> |