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 d6f491abb90c048fe8ae2682d677722ebd2457be..86232a60710a43ff9841960e055bebd40cd0a5aa 100644 |
--- a/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc |
+++ b/chrome/browser/apps/guest_view/web_view_interactive_browsertest.cc |
@@ -1077,9 +1077,9 @@ IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, |
// 3. User brings back the focus directly to the <input> in #1. |
// |
// Now we need to make sure TextInputTypeChanged fires properly for the guest's |
-// view upon step #3. We simply read the input type's state after #3 to |
-// make sure it's not TEXT_INPUT_TYPE_NONE. |
-IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, Focus_FocusRestored) { |
+// view upon step #3. We read the input type's state after #3 to make sure it's |
+// not TEXT_INPUT_TYPE_NONE. |
+IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, DISABLED_Focus_FocusRestored) { |
TestHelper("testFocusRestored", "web_view/focus", NO_TEST_SERVER); |
content::WebContents* embedder_web_contents = GetFirstAppWindowWebContents(); |
ASSERT_TRUE(embedder_web_contents); |
@@ -1138,8 +1138,14 @@ IN_PROC_BROWSER_TEST_F(WebViewInteractiveTest, Focus_FocusRestored) { |
->GetView() |
->GetTextInputClient(); |
ASSERT_TRUE(text_input_client); |
- ASSERT_TRUE(text_input_client->GetTextInputType() != |
- ui::TEXT_INPUT_TYPE_NONE); |
+ |
+ // Wait until GetTextInputType becomes something other than NONE. |
+ // NOTE: this may not pass because TextInputStateChanged messages from two |
+ // render widgets arrive on the same RenderWidgetHostViewAura. Embedder's NONE |
+ // type may arrive later than guest webview's TEXT type depending on the |
+ // timing. |
+ while (text_input_client->GetTextInputType() == ui::TEXT_INPUT_TYPE_NONE) |
+ base::MessageLoop::current()->RunUntilIdle(); |
#endif |
} |