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

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

Issue 2391353003: Prevent inline install on fullscreen windows. (Closed)
Patch Set: Updating with reviewer commments. 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..9e15545650b51992dd6b61ec930f149553ff26d4 100644
--- a/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
+++ b/chrome/browser/extensions/webstore_inline_installer_browsertest.cc
@@ -256,6 +256,52 @@ IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
RunTest(popup_contents, "runTest");
}
+// Prevent inline install while in browser fullscreen mode. Browser fullscreen
+// is initiated by the user using F11.
+IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
+ BlockInlineInstallFromFullscreenForBrowser) {
+ const GURL install_url =
+ GenerateTestServerUrl(kAppDomain, "install_from_fullscreen.html");
+ ui_test_utils::NavigateToURL(browser(), install_url);
+ AutoAcceptInstall();
+
+ // 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"));
+}
+
+// Prevent inline install while in tab fullscreen mode. Tab fullscreen is
+// initiated using the browser API.
meacer 2016/10/10 19:44:00 nit: ... initiated by the page using requestFullsc
+IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallerTest,
+ BlockInlineInstallFromFullscreenForTab) {
+ const GURL install_url =
+ GenerateTestServerUrl(kAppDomain, "install_from_fullscreen.html");
+ ui_test_utils::NavigateToURL(browser(), install_url);
+ AutoAcceptInstall();
+ 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