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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 298283003: Add WasShown/WasHidden to RenderFrameObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on ToT. 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/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 5c3be864b904cfc6a61f347b1cea5b80841405bc..1bcf3fc8a4e7919ff96c75f64111af868b5f2450 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -216,6 +216,14 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) {
NavigateFrameToURL(root->child_at(0), http_url);
EXPECT_EQ(http_url, observer.navigation_url());
EXPECT_TRUE(observer.navigation_succeeded());
+ {
+ // There should be only one RenderWidgetHost when there are no
+ // cross-process iframes.
+ std::set<RenderWidgetHostImpl*> widgets_set =
+ static_cast<WebContentsImpl*>(shell()->web_contents())
+ ->GetRenderWidgetHostsInTree();
+ EXPECT_EQ(1U, widgets_set.size());
+ }
// These must stay in scope with replace_host.
GURL::Replacements replace_host;
@@ -238,6 +246,14 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) {
EXPECT_NE(shell()->web_contents()->GetRenderViewHost(), rvh);
EXPECT_NE(shell()->web_contents()->GetSiteInstance(), site_instance);
EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(), rph);
+ {
+ // There should be now two RenderWidgetHosts, one for each process
+ // rendering a frame.
+ std::set<RenderWidgetHostImpl*> widgets_set =
+ static_cast<WebContentsImpl*>(shell()->web_contents())
+ ->GetRenderWidgetHostsInTree();
+ EXPECT_EQ(2U, widgets_set.size());
+ }
// Load another cross-site page into the same iframe.
cross_site_url = test_server()->GetURL("files/title3.html");
@@ -262,6 +278,12 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, CrossSiteIframe) {
EXPECT_NE(shell()->web_contents()->GetRenderProcessHost(),
child->current_frame_host()->GetProcess());
EXPECT_NE(rph, child->current_frame_host()->GetProcess());
+ {
+ std::set<RenderWidgetHostImpl*> widgets_set =
+ static_cast<WebContentsImpl*>(shell()->web_contents())
+ ->GetRenderWidgetHostsInTree();
+ EXPECT_EQ(2U, widgets_set.size());
+ }
}
// Crash a subframe and ensures its children are cleared from the FrameTree.
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698