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

Unified Diff: content/browser/web_contents/web_contents_impl_browsertest.cc

Issue 196283013: Make to call WebContentsImpl::RenderViewCreated() when we create child window. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl_browsertest.cc
===================================================================
--- content/browser/web_contents/web_contents_impl_browsertest.cc (revision 256801)
+++ content/browser/web_contents/web_contents_impl_browsertest.cc (working copy)
@@ -385,4 +385,23 @@
EXPECT_EQ(observer.last_rfh(), shell()->web_contents()->GetMainFrame());
}
+IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest,
+ RenderViewCreatedForChildWindow) {
+ ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady());
+
+ NavigateToURL(shell(),
+ embedded_test_server()->GetURL("/title1.html"));
+
+ WebContentsAddedObserver new_web_contents_observer;
+ ASSERT_TRUE(ExecuteScript(shell()->web_contents(),
+ "var a = document.createElement('a');"
+ "a.href='./title2.html';"
+ "a.target = '_blank';"
+ "document.body.appendChild(a);"
+ "a.click();"));
+ WebContents* new_web_contents = new_web_contents_observer.GetWebContents();
+ WaitForLoadStop(new_web_contents);
+ EXPECT_TRUE(new_web_contents_observer.RenderViewCreatedCalled());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698