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

Side by Side Diff: chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc

Issue 1388283002: Fix OSK flickering issue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix more tests except for contextualsearchmanagertests Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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 "base/location.h" 5 #include "base/location.h"
6 #include "base/single_thread_task_runner.h" 6 #include "base/single_thread_task_runner.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 FullscreenTestHelper("testFullscreenDeny", 1070 FullscreenTestHelper("testFullscreenDeny",
1071 "web_view/fullscreen/embedder_has_no_permission"); 1071 "web_view/fullscreen/embedder_has_no_permission");
1072 } 1072 }
1073 1073
1074 // This test exercies the following scenario: 1074 // This test exercies the following scenario:
1075 // 1. An <input> in guest has focus. 1075 // 1. An <input> in guest has focus.
1076 // 2. User takes focus to embedder by clicking e.g. an <input> in embedder. 1076 // 2. User takes focus to embedder by clicking e.g. an <input> in embedder.
1077 // 3. User brings back the focus directly to the <input> in #1. 1077 // 3. User brings back the focus directly to the <input> in #1.
1078 // 1078 //
1079 // Now we need to make sure TextInputTypeChanged fires properly for the guest's 1079 // Now we need to make sure TextInputTypeChanged fires properly for the guest's
1080 // view upon step #3. We simply read the input type's state after #3 to 1080 // view upon step #3. We read the input type's state after #3 to make sure it's
1081 // make sure it's not TEXT_INPUT_TYPE_NONE. 1081 // not TEXT_INPUT_TYPE_NONE.
1082 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, Focus_FocusRestored) { 1082 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DISABLED_Focus_FocusRestored) {
1083 TestHelper("testFocusRestored", "web_view/focus", NO_TEST_SERVER); 1083 TestHelper("testFocusRestored", "web_view/focus", NO_TEST_SERVER);
1084 content::WebContents* embedder_web_contents = GetFirstAppWindowWebContents(); 1084 content::WebContents* embedder_web_contents = GetFirstAppWindowWebContents();
1085 ASSERT_TRUE(embedder_web_contents); 1085 ASSERT_TRUE(embedder_web_contents);
1086 ASSERT_TRUE(guest_web_contents()); 1086 ASSERT_TRUE(guest_web_contents());
1087 1087
1088 // 1) We click on the guest so that we get a focus event. 1088 // 1) We click on the guest so that we get a focus event.
1089 ExtensionTestMessageListener next_step_listener("TEST_STEP_PASSED", false); 1089 ExtensionTestMessageListener next_step_listener("TEST_STEP_PASSED", false);
1090 next_step_listener.set_failure_message("TEST_STEP_FAILED"); 1090 next_step_listener.set_failure_message("TEST_STEP_FAILED");
1091 { 1091 {
1092 content::SimulateMouseClickAt(guest_web_contents(), 1092 content::SimulateMouseClickAt(guest_web_contents(),
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); 1131 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied());
1132 1132
1133 // |text_input_client| is not available for mac and android. 1133 // |text_input_client| is not available for mac and android.
1134 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 1134 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
1135 ui::TextInputClient* text_input_client = 1135 ui::TextInputClient* text_input_client =
1136 embedder_web_contents->GetRenderViewHost() 1136 embedder_web_contents->GetRenderViewHost()
1137 ->GetWidget() 1137 ->GetWidget()
1138 ->GetView() 1138 ->GetView()
1139 ->GetTextInputClient(); 1139 ->GetTextInputClient();
1140 ASSERT_TRUE(text_input_client); 1140 ASSERT_TRUE(text_input_client);
1141 ASSERT_TRUE(text_input_client->GetTextInputType() != 1141
1142 ui::TEXT_INPUT_TYPE_NONE); 1142 // Wait until GetTextInputType becomes something other than NONE.
1143 // NOTE: this may not pass because TextInputStateChanged messages from two
1144 // render widgets arrive on the same RenderWidgetHostViewAura. Embedder's NONE
1145 // type may arrive later than guest webview's TEXT type depending on the
1146 // timing.
1147 while (text_input_client->GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE)
1148 base::MessageLoop::current()->RunUntilIdle();
1143 #endif 1149 #endif
1144 } 1150 }
1145 1151
1146 // ui::TextInputClient is NULL for mac and android. 1152 // ui::TextInputClient is NULL for mac and android.
1147 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 1153 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
1148 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DISABLED_Focus_InputMethod) { 1154 IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DISABLED_Focus_InputMethod) {
1149 content::WebContents* embedder_web_contents = NULL; 1155 content::WebContents* embedder_web_contents = NULL;
1150 scoped_ptr<ExtensionTestMessageListener> done_listener( 1156 scoped_ptr<ExtensionTestMessageListener> done_listener(
1151 RunAppHelper("testInputMethod", "web_view/focus", NO_TEST_SERVER, 1157 RunAppHelper("testInputMethod", "web_view/focus", NO_TEST_SERVER,
1152 &embedder_web_contents)); 1158 &embedder_web_contents));
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 // this time. 1281 // this time.
1276 for (size_t i = 0; i < 4; ++i) 1282 for (size_t i = 0; i < 4; ++i)
1277 SendKeyPressToPlatformApp(ui::VKEY_TAB); 1283 SendKeyPressToPlatformApp(ui::VKEY_TAB);
1278 ExtensionTestMessageListener webview_button_not_focused_listener( 1284 ExtensionTestMessageListener webview_button_not_focused_listener(
1279 "WebViewInteractiveTest.WebViewButtonWasNotFocused", false); 1285 "WebViewInteractiveTest.WebViewButtonWasNotFocused", false);
1280 webview_button_not_focused_listener.set_failure_message( 1286 webview_button_not_focused_listener.set_failure_message(
1281 "WebViewInteractiveTest.WebViewButtonWasFocused"); 1287 "WebViewInteractiveTest.WebViewButtonWasFocused");
1282 SendMessageToEmbedder("verify"); 1288 SendMessageToEmbedder("verify");
1283 EXPECT_TRUE(webview_button_not_focused_listener.WaitUntilSatisfied()); 1289 EXPECT_TRUE(webview_button_not_focused_listener.WaitUntilSatisfied());
1284 } 1290 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698