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

Unified Diff: chrome/browser/extensions/webstore_inline_installer_browsertest.cc

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/browser/extensions/webstore_inline_installer_browsertest.cc
diff --git a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
index f06cfa6f237132848b74bdf18430422ac528df48..bfc743cadea03eef5a26a7c0edb36dfcd951694b 100644
--- a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
@@ -11,9 +11,11 @@
#include "chrome/browser/extensions/webstore_standalone_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_finder.h"
Devlin 2015/02/12 17:18:21 needed?
meacer 2015/02/12 21:12:05 Not anymore :)
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/test/browser_test_utils.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "url/gurl.h"
@@ -126,7 +128,7 @@ class WebstoreInlineInstallerForTestFactory :
};
IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
- CloseTabBeforeInstallConfirmation) {
+ CloseTabBeforeInstallConfirmation) {
GURL install_url = GenerateTestServerUrl(kAppDomain, "install.html");
ui_test_utils::NavigateToURL(browser(), install_url);
WebContents* web_contents =
@@ -141,6 +143,18 @@ IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
ProgrammableInstallPrompt::Accept();
}
+IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
+ ShouldBlockInlineInstallFromPopupWindow) {
+ GURL install_url =
+ GenerateTestServerUrl(kAppDomain, "install_from_popup.html");
+ content::OpenURLParams params(install_url, content::Referrer(), NEW_POPUP,
+ ui::PAGE_TRANSITION_TYPED, false);
+ params.user_gesture = true;
+ WebContents* web_contents = browser()->OpenURL(params);
+ WaitForLoadStop(web_contents);
+ RunTest(web_contents, "runTest");
+}
+
// Ensure that inline-installing a disabled extension simply re-enables it.
IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
ReinstallDisabledExtension) {

Powered by Google App Engine
This is Rietveld 408576698