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

Unified Diff: chrome/browser/ui/exclusive_access/flash_fullscreen_interactive_browsertest.cc

Issue 2123093005: Add a test for Flash Fullscreen from a cross-site subframe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more fix Created 4 years, 5 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 | « no previous file | chrome/interactive_ui_tests.isolate » ('j') | chrome/interactive_ui_tests.isolate » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/exclusive_access/flash_fullscreen_interactive_browsertest.cc
diff --git a/chrome/browser/ui/exclusive_access/flash_fullscreen_interactive_browsertest.cc b/chrome/browser/ui/exclusive_access/flash_fullscreen_interactive_browsertest.cc
index cbeaf9047f605d2a29f4a2f57cce8a665af0e665..b476f586bd00f90f4db804fc6b79cfd07150acec 100644
--- a/chrome/browser/ui/exclusive_access/flash_fullscreen_interactive_browsertest.cc
+++ b/chrome/browser/ui/exclusive_access/flash_fullscreen_interactive_browsertest.cc
@@ -89,6 +89,38 @@ class FlashFullscreenInteractiveBrowserTest : public OutOfProcessPPAPITest {
return !::testing::Test::HasFailure();
}
+ bool LaunchFlashFullscreenInSubframe() {
+ // Start the embedded test server and set it up to serve PPAPI test case
+ // URLs.
+ base::FilePath document_root;
+ EXPECT_TRUE(ui_test_utils::GetRelativeBuildDirectory(&document_root));
+ embedded_test_server()->AddDefaultHandlers(document_root);
+ if (!embedded_test_server()->Start()) {
+ ADD_FAILURE() << "Failed to launch embedded test server.";
+ return false;
+ }
+
+ // Load a page with an <iframe> that points to the test case URL, which
+ // runs the simulated fullscreen Flash plugin. In OOPIF modes, the frame
+ // will render in a separate process. Block until the plugin has completed
+ // an attempt to enter Flash fullscreen mode.
+ GURL test_url = GetTestURL(*embedded_test_server(),
+ "FlashFullscreenForBrowserUI", std::string());
+ GURL main_url("data:text/html,<iframe src='" + test_url.spec() +
+ "'></iframe>");
+ OutOfProcessPPAPITest::RunTestURL(main_url);
+
+ if (::testing::Test::HasFailure()) {
+ ADD_FAILURE() << ("Failed to launch simulated fullscreen Flash plugin. "
+ "Interactive UI testing cannot proceed.");
+ return false;
+ }
+
+ EXPECT_TRUE(ObserveTabIsInFullscreen(true));
+
+ return !::testing::Test::HasFailure();
+ }
+
void UseAcceleratorToOpenNewTab() {
content::WebContents* const old_tab_contents = GetActiveWebContents();
EXPECT_TRUE(ui_test_utils::SendKeyPressSync(
@@ -272,6 +304,17 @@ IN_PROC_BROWSER_TEST_F(FlashFullscreenInteractiveBrowserTest,
EXPECT_TRUE(ObserveTabIsInFullscreen(false));
}
+IN_PROC_BROWSER_TEST_F(FlashFullscreenInteractiveBrowserTest,
+ FullscreenFromSubframe) {
+ ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
+ StartFakingTabCapture();
+ ASSERT_TRUE(LaunchFlashFullscreenInSubframe());
+ content::WebContents* const first_tab_contents = GetActiveWebContents();
+ EXPECT_TRUE(ObserveFlashHasFocus(first_tab_contents, true));
+ PressEscape();
+ EXPECT_TRUE(ObserveTabIsInFullscreen(false));
+}
+
// This tests that browser UI focus behavior is correct when switching between
// tabs; particularly, that that focus between the omnibox and tab contents is
// stored/restored correctly. Mouse and keyboard events are used to confirm
« no previous file with comments | « no previous file | chrome/interactive_ui_tests.isolate » ('j') | chrome/interactive_ui_tests.isolate » ('J')

Powered by Google App Engine
This is Rietveld 408576698