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

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: Open the popup from the test file rather than using browser navigation 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
« no previous file with comments | « chrome/browser/extensions/webstore_installer_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « chrome/browser/extensions/webstore_installer_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698