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

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

Issue 2391353003: Prevent inline install on fullscreen windows. (Closed)
Patch Set: Prevent install from tab for fullscreen as well and fix browser test. Created 4 years, 2 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 a2a25b7bda28e4da75a5667a87f3a95a2aa800b8..139d05d4e08a7b35df05aee430adf5611724c238 100644
--- a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
@@ -256,6 +256,48 @@ IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
RunTest(popup_contents, "runTest");
}
+IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
+ BlockInlineInstallFromFullscreenForBrowser) {
meacer 2016/10/10 17:57:33 nit: Can you add a comment for this test explainin
Ackerman 2016/10/10 19:35:58 Done.
+ GURL install_url =
meacer 2016/10/10 17:57:33 nit: const GURL install_url =
Ackerman 2016/10/10 19:35:58 Done.
+ GenerateTestServerUrl(kAppDomain, "install_from_fullscreen.html");
+ ui_test_utils::NavigateToURL(browser(), install_url);
+ AutoAcceptInstall();
meacer 2016/10/10 17:57:33 You probably don't need this since the dialog won'
Devlin 2016/10/10 18:35:59 I think I suggested this when Ben was talking to m
Ackerman 2016/10/10 19:35:58 Keeping per Devlin's comments.
meacer 2016/10/10 19:44:00 Okay, sounds good. I guess without it the test wou
+
+ // Enter browser fullscreen mode.
+ FullscreenController* controller =
+ browser()->exclusive_access_manager()->fullscreen_controller();
+ controller->ToggleBrowserFullscreenMode();
+
+ RunTest("runTest");
+
+ // Ensure extension is not installed.
+ ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
+ EXPECT_FALSE(registry->GenerateInstalledExtensionsSet()->Contains(
+ "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"));
+}
+
+IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
+ BlockInlineInstallFromFullscreenForTab) {
+ GURL install_url =
meacer 2016/10/10 17:57:33 nit: const GURL install_url =
Ackerman 2016/10/10 19:35:58 Done.
+ GenerateTestServerUrl(kAppDomain, "install_from_fullscreen.html");
+ ui_test_utils::NavigateToURL(browser(), install_url);
+ AutoAcceptInstall();
meacer 2016/10/10 17:57:33 Also not needed?
Ackerman 2016/10/10 19:35:58 Same comment as above.
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+ FullscreenController* controller =
+ browser()->exclusive_access_manager()->fullscreen_controller();
+
+ // Enter tab fullscreen mode.
+ controller->EnterFullscreenModeForTab(web_contents, install_url);
+
+ RunTest("runTest");
+
+ // Ensure extension is not installed.
+ ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
+ EXPECT_FALSE(registry->GenerateInstalledExtensionsSet()->Contains(
+ "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"));
+}
+
// 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