Chromium Code Reviews| 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 c8a839c0b6e1d07ab6e1b6a86c883575165f4005..bcdd6e38affe634805fd1fc52a6869cb7da4ec8d 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(); |
| } |
| @@ -1345,3 +1346,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)); |
|
alexmos
2016/06/07 22:03:43
This expected to land on the <input> field created
avallee
2016/06/15 13:32:10
1. Comment added.
2. Looking at it, I think you're
|
| + } |
| + ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); |
| + if (GetParam()) { |
| + EXPECT_NE(embedder_web_contents()->GetFocusedFrame(), |
|
alexmos
2016/06/07 22:03:43
embedder_web_contents()->GetFocusedFrame() should
avallee
2016/06/15 13:32:10
Done.
|
| + 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()); |
| +} |