| 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 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 // Now verify that the selection text propagates properly to RWHV. | 1318 // Now verify that the selection text propagates properly to RWHV. |
| 1319 content::RenderWidgetHostView* guest_rwhv = | 1319 content::RenderWidgetHostView* guest_rwhv = |
| 1320 guest_web_contents()->GetRenderWidgetHostView(); | 1320 guest_web_contents()->GetRenderWidgetHostView(); |
| 1321 ASSERT_TRUE(guest_rwhv); | 1321 ASSERT_TRUE(guest_rwhv); |
| 1322 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); | 1322 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); |
| 1323 ASSERT_TRUE(selected_text.size() >= 10u); | 1323 ASSERT_TRUE(selected_text.size() >= 10u); |
| 1324 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); | 1324 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); |
| 1325 } | 1325 } |
| 1326 #endif | 1326 #endif |
| 1327 | 1327 |
| 1328 IN_PROC_BROWSER_TEST_F(WebViewFocusInteractiveTest, FocusAndVisibility) { | 1328 // Flaky on MacOS builders. https://crbug.com/670008 |
| 1329 #if defined(OS_MACOSX) |
| 1330 #define MAYBE_FocusAndVisibility DISABLED_FocusAndVisibility |
| 1331 #else |
| 1332 #define MAYBE_FocusAndVisibility FocusAndVisibility |
| 1333 #endif |
| 1334 |
| 1335 IN_PROC_BROWSER_TEST_F(WebViewFocusInteractiveTest, MAYBE_FocusAndVisibility) { |
| 1329 ASSERT_TRUE(StartEmbeddedTestServer()); | 1336 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 1330 LoadAndLaunchPlatformApp("web_view/focus_visibility", | 1337 LoadAndLaunchPlatformApp("web_view/focus_visibility", |
| 1331 "WebViewInteractiveTest.LOADED"); | 1338 "WebViewInteractiveTest.LOADED"); |
| 1332 ExtensionTestMessageListener test_init_listener( | 1339 ExtensionTestMessageListener test_init_listener( |
| 1333 "WebViewInteractiveTest.WebViewInitialized", false); | 1340 "WebViewInteractiveTest.WebViewInitialized", false); |
| 1334 SendMessageToEmbedder("init"); | 1341 SendMessageToEmbedder("init"); |
| 1335 test_init_listener.WaitUntilSatisfied(); | 1342 test_init_listener.WaitUntilSatisfied(); |
| 1336 // Send several tab-keys. The button inside webview should receive focus at | 1343 // Send several tab-keys. The button inside webview should receive focus at |
| 1337 // least once. | 1344 // least once. |
| 1338 for (size_t i = 0; i < 4; ++i) | 1345 for (size_t i = 0; i < 4; ++i) |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 1464 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
| 1458 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); | 1465 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); |
| 1459 | 1466 |
| 1460 next_step_listener.Reset(); | 1467 next_step_listener.Reset(); |
| 1461 EXPECT_TRUE(content::ExecuteScript( | 1468 EXPECT_TRUE(content::ExecuteScript( |
| 1462 embedder_web_contents(), | 1469 embedder_web_contents(), |
| 1463 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); | 1470 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); |
| 1464 | 1471 |
| 1465 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); | 1472 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); |
| 1466 } | 1473 } |
| OLD | NEW |