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

Unified Diff: chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase ToT Created 4 years, 6 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/apps/guest_view/web_view_interactive_browsertest.cc
diff --git a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
index a253a144c69b49783b30563b5d0e8f191c7ebb13..363ad96516e3c798fb72f55661e33db1d7fb0dbc 100644
--- a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc
@@ -227,6 +227,7 @@ class WebViewInteractiveTestBase : public extensions::PlatformAppBrowserTest {
ASSERT_TRUE(done_listener);
ASSERT_TRUE(done_listener->WaitUntilSatisfied());
+ embedder_web_contents_ = embedder_web_contents;
guest_web_contents_ = GetGuestViewManager()->WaitForSingleGuestCreated();
}
@@ -1347,3 +1348,36 @@ IN_PROC_BROWSER_TEST_F(WebViewFocusInteractiveTest, FocusAndVisibility) {
SendMessageToEmbedder("verify");
EXPECT_TRUE(webview_button_not_focused_listener.WaitUntilSatisfied());
}
+
+IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, KeyboardFocus) {
+ TestHelper("testKeyboardFocus", "web_view/focus", NO_TEST_SERVER);
+
+ EXPECT_EQ(embedder_web_contents()->GetFocusedFrame(),
+ embedder_web_contents()->GetMainFrame());
+ ExtensionTestMessageListener next_step_listener("TEST_STEP_PASSED", false);
+ next_step_listener.set_failure_message("TEST_STEP_FAILED");
+ {
+ content::SimulateMouseClickAt(embedder_web_contents(), 0,
+ blink::WebMouseEvent::ButtonLeft,
+ gfx::Point(40, 40));
+ }
+ ASSERT_TRUE(next_step_listener.WaitUntilSatisfied());
+ if (GetParam()) {
+ EXPECT_NE(embedder_web_contents()->GetFocusedFrame(),
+ embedder_web_contents()->GetMainFrame());
+ }
+
+ content::SimulateKeyPress(embedder_web_contents(), ui::VKEY_A, false, false,
+ false, false);
+ content::SimulateKeyPress(embedder_web_contents(), ui::VKEY_B, false, false,
+ false, false);
+ content::SimulateKeyPress(embedder_web_contents(), ui::VKEY_C, false, true,
+ false, false);
+
+ next_step_listener.Reset();
+ EXPECT_TRUE(content::ExecuteScript(
+ embedder_web_contents(),
+ "window.runCommand('testKeyboardFocusRunNextStep', 'ABC');"));
+
+ ASSERT_TRUE(next_step_listener.WaitUntilSatisfied());
+}

Powered by Google App Engine
This is Rietveld 408576698