Index: chrome/test/data/extensions/api_test/webstore_inline_install/install_from_popup.html |
diff --git a/chrome/test/data/extensions/api_test/webstore_inline_install/install_from_popup.html b/chrome/test/data/extensions/api_test/webstore_inline_install/install_from_popup.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e80e5890b4bf940ef9e0aba06318ce512c5fca88 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/webstore_inline_install/install_from_popup.html |
@@ -0,0 +1,42 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <link rel="chrome-webstore-item"> |
+</head> |
+<body> |
+<script> |
+if (window.location.search == "") { |
+ window.open(window.location.href + "?install", "w", "toolbar=no"); |
+} else { |
+ document.title = "POPUP"; |
+} |
+ |
+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 { |
+ chrome.webstore.install( |
+ undefined, |
+ function() { |
+ console.error('Did not expect install complete in a pop-up window.'); |
+ window.domAutomationController.send(false); |
+ }, |
+ function(error) { |
+ var expected_error = |
+ "Inline installs can not be initiated from pop-up windows."; |
+ window.domAutomationController.send(error == expected_error); |
+ } |
+ ); |
+ } catch (e) { |
+ console.error('Unexpected exception: ', e); |
+ window.domAutomationController.send(false); |
+ throw e; |
+ } |
+} |
+</script> |
+ |
+</body> |
+</html> |