| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 "window.runCommand('testKeyboardFocusRunNextStep', 'aBc');")); | 1460 "window.runCommand('testKeyboardFocusRunNextStep', 'aBc');")); |
| 1461 | 1461 |
| 1462 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); | 1462 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 // Ensures that input is routed to the webview after the containing window loses | 1465 // Ensures that input is routed to the webview after the containing window loses |
| 1466 // and regains focus. Additionally, the webview does not process keypresses sent | 1466 // and regains focus. Additionally, the webview does not process keypresses sent |
| 1467 // while another window is focused. | 1467 // while another window is focused. |
| 1468 // http://crbug.com/660044. | 1468 // http://crbug.com/660044. |
| 1469 IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, KeyboardFocusWindowCycle) { | 1469 IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, KeyboardFocusWindowCycle) { |
| 1470 #if defined(OS_LINUX) |
| 1471 // Flaky on linux, crbug.com/706830. |
| 1472 if (GetParam()) |
| 1473 return; |
| 1474 #endif // defined(OS_LINUX) |
| 1470 TestHelper("testKeyboardFocusWindowFocusCycle", "web_view/focus", | 1475 TestHelper("testKeyboardFocusWindowFocusCycle", "web_view/focus", |
| 1471 NO_TEST_SERVER); | 1476 NO_TEST_SERVER); |
| 1472 | 1477 |
| 1473 EXPECT_EQ(embedder_web_contents()->GetFocusedFrame(), | 1478 EXPECT_EQ(embedder_web_contents()->GetFocusedFrame(), |
| 1474 embedder_web_contents()->GetMainFrame()); | 1479 embedder_web_contents()->GetMainFrame()); |
| 1475 ExtensionTestMessageListener next_step_listener("TEST_STEP_PASSED", false); | 1480 ExtensionTestMessageListener next_step_listener("TEST_STEP_PASSED", false); |
| 1476 next_step_listener.set_failure_message("TEST_STEP_FAILED"); | 1481 next_step_listener.set_failure_message("TEST_STEP_FAILED"); |
| 1477 { | 1482 { |
| 1478 gfx::Rect offset = embedder_web_contents()->GetContainerBounds(); | 1483 gfx::Rect offset = embedder_web_contents()->GetContainerBounds(); |
| 1479 // Click the <input> element inside the <webview>. | 1484 // Click the <input> element inside the <webview>. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 // Get the input value from the guest. | 1590 // Get the input value from the guest. |
| 1586 value.clear(); | 1591 value.clear(); |
| 1587 ASSERT_TRUE(ExecuteScriptAndExtractString(guest_web_contents, | 1592 ASSERT_TRUE(ExecuteScriptAndExtractString(guest_web_contents, |
| 1588 "window.domAutomationController." | 1593 "window.domAutomationController." |
| 1589 "send(document.querySelector('" | 1594 "send(document.querySelector('" |
| 1590 "input').value)", | 1595 "input').value)", |
| 1591 &value)); | 1596 &value)); |
| 1592 EXPECT_EQ("A B C D", value); | 1597 EXPECT_EQ("A B C D", value); |
| 1593 } | 1598 } |
| 1594 #endif // OS_MACOSX | 1599 #endif // OS_MACOSX |
| OLD | NEW |