Index: chrome/test/base/in_process_browser_test.cc |
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc |
index 82c0706dda5ab9cfdcbf5fe43d4da28166e836fc..088b6a971d686d4c54c5f201f10b6a59a9bc1d57 100644 |
--- a/chrome/test/base/in_process_browser_test.cc |
+++ b/chrome/test/base/in_process_browser_test.cc |
@@ -392,8 +392,16 @@ void InProcessBrowserTest::RunTestOnMainThreadLoop() { |
if (browser_->window()->IsMaximized()) |
browser_->window()->Restore(); |
#endif |
- content::WaitForLoadStop( |
- browser_->tab_strip_model()->GetActiveWebContents()); |
+ content::WebContents* web_contents = |
+ browser_->tab_strip_model()->GetActiveWebContents(); |
+ content::WaitForLoadStop(web_contents); |
+ // The RenderView for WebContents is created as a result of the navigation |
+ // to the New Tab page. The creation involves sending a resize message to |
+ // the renderer process. Here we wait for the resize ack to be received, |
+ // since tests may not expect to start in a "waiting for resize" state. |
+ // E.g. currently WindowEventDispatcher has code to hold touch and mouse |
+ // move events until resize is complete (crbug.com/384342) |
+ content::WaitForResizeComplete(web_contents); |
} |
#if !defined(OS_ANDROID) && !defined(OS_IOS) |