Chromium Code Reviews| 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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1278 EXPECT_TRUE(content::ExecuteScript( | 1278 EXPECT_TRUE(content::ExecuteScript( |
| 1279 embedder_web_contents, | 1279 embedder_web_contents, |
| 1280 "window.runCommand('testInputMethodRunNextStep', 3);")); | 1280 "window.runCommand('testInputMethodRunNextStep', 3);")); |
| 1281 | 1281 |
| 1282 // Wait for the next step to complete. | 1282 // Wait for the next step to complete. |
| 1283 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); | 1283 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); |
| 1284 } | 1284 } |
| 1285 } | 1285 } |
| 1286 #endif | 1286 #endif |
| 1287 | 1287 |
| 1288 #if defined(OS_MACOSX) | |
| 1289 IN_PROC_BROWSER_TEST_P(WebViewInteractiveTest, TextSelection) { | |
|
EhsanK
2016/07/13 17:44:57
This is just testing that RWHVGuest::GetSelectedTe
| |
| 1290 #if defined(OS_MACOSX) | |
| 1291 // TODO(ekaramad): This test is failing under OOPIF for MAC. | |
| 1292 if (GetParam()) | |
| 1293 return; | |
| 1294 #endif | |
| 1295 SetupTest("web_view/text_selection", | |
| 1296 "/extensions/platform_apps/web_view/text_selection/guest.html"); | |
| 1297 ASSERT_TRUE(guest_web_contents()); | |
| 1298 ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow( | |
| 1299 GetPlatformAppWindow())); | |
| 1300 | |
| 1301 // Wait until guest sees a context menu, select an arbitrary item (copy). | |
| 1302 ExtensionTestMessageListener ctx_listener("MSG_CONTEXTMENU", false); | |
| 1303 ContextMenuNotificationObserver menu_observer(IDC_CONTENT_CONTEXT_COPY); | |
| 1304 SimulateRWHMouseClick(guest_web_contents()->GetRenderViewHost()->GetWidget(), | |
| 1305 blink::WebMouseEvent::ButtonRight, 20, 20); | |
| 1306 ASSERT_TRUE(ctx_listener.WaitUntilSatisfied()); | |
| 1307 | |
| 1308 // Now verify that the selection text propagates properly to RWHV. | |
| 1309 content::RenderWidgetHostView* guest_rwhv = | |
| 1310 guest_web_contents()->GetRenderWidgetHostView(); | |
| 1311 ASSERT_TRUE(guest_rwhv); | |
| 1312 std::string selected_text = base::UTF16ToUTF8(guest_rwhv->GetSelectedText()); | |
| 1313 ASSERT_TRUE(selected_text.size() >= 10u); | |
| 1314 ASSERT_EQ("AAAAAAAAAA", selected_text.substr(0, 10)); | |
| 1315 } | |
| 1316 #endif | |
| 1317 | |
| 1318 IN_PROC_BROWSER_TEST_F(WebViewFocusInteractiveTest, FocusAndVisibility) { | 1288 IN_PROC_BROWSER_TEST_F(WebViewFocusInteractiveTest, FocusAndVisibility) { |
| 1319 ASSERT_TRUE(StartEmbeddedTestServer()); | 1289 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 1320 LoadAndLaunchPlatformApp("web_view/focus_visibility", | 1290 LoadAndLaunchPlatformApp("web_view/focus_visibility", |
| 1321 "WebViewInteractiveTest.LOADED"); | 1291 "WebViewInteractiveTest.LOADED"); |
| 1322 ExtensionTestMessageListener test_init_listener( | 1292 ExtensionTestMessageListener test_init_listener( |
| 1323 "WebViewInteractiveTest.WebViewInitialized", false); | 1293 "WebViewInteractiveTest.WebViewInitialized", false); |
| 1324 SendMessageToEmbedder("init"); | 1294 SendMessageToEmbedder("init"); |
| 1325 test_init_listener.WaitUntilSatisfied(); | 1295 test_init_listener.WaitUntilSatisfied(); |
| 1326 // Send several tab-keys. The button inside webview should receive focus at | 1296 // Send several tab-keys. The button inside webview should receive focus at |
| 1327 // least once. | 1297 // least once. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1346 // this time. | 1316 // this time. |
| 1347 for (size_t i = 0; i < 4; ++i) | 1317 for (size_t i = 0; i < 4; ++i) |
| 1348 SendKeyPressToPlatformApp(ui::VKEY_TAB); | 1318 SendKeyPressToPlatformApp(ui::VKEY_TAB); |
| 1349 ExtensionTestMessageListener webview_button_not_focused_listener( | 1319 ExtensionTestMessageListener webview_button_not_focused_listener( |
| 1350 "WebViewInteractiveTest.WebViewButtonWasNotFocused", false); | 1320 "WebViewInteractiveTest.WebViewButtonWasNotFocused", false); |
| 1351 webview_button_not_focused_listener.set_failure_message( | 1321 webview_button_not_focused_listener.set_failure_message( |
| 1352 "WebViewInteractiveTest.WebViewButtonWasFocused"); | 1322 "WebViewInteractiveTest.WebViewButtonWasFocused"); |
| 1353 SendMessageToEmbedder("verify"); | 1323 SendMessageToEmbedder("verify"); |
| 1354 EXPECT_TRUE(webview_button_not_focused_listener.WaitUntilSatisfied()); | 1324 EXPECT_TRUE(webview_button_not_focused_listener.WaitUntilSatisfied()); |
| 1355 } | 1325 } |
| OLD | NEW |