Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: chrome/test/data/extensions/api_test/webstore_inline_install/install_from_popup.html

Issue 908063002: Prevent inline CRX installs in popup windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dont include cc file Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f760616c146fa163f99094c2011b1d36d41b2cb0
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/webstore_inline_install/install_from_popup.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <link rel="chrome-webstore-item">
+</head>
+<body>
+<script>
+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.log('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.";
+ console.log('Ran test, sending response');
Devlin 2015/02/12 17:18:21 I know that we do this a lot, but we really should
meacer 2015/02/12 21:12:05 Done.
+ window.domAutomationController.send(error == expected_error);
+ }
+ );
+ } catch (e) {
+ console.log('Unexpected exception: ' + e);
+ window.domAutomationController.send(false);
+ throw e;
+ }
+}
+</script>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698