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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1851633002: Fix flaky DontReusePendingDeleteRenderViewHostForSubframe test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5e208779bb67783934a6834044065f83f13dafff..8e12c9ae518504adad63c7d1835a1e8dcc524ecb 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -4176,12 +4176,6 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
GURL main_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
EXPECT_TRUE(NavigateToURL(shell(), main_url));
- FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
- ->GetFrameTree()
- ->root();
- RenderViewHostImpl* rvh_a = root->current_frame_host()->render_view_host();
- int rvh_a_routing_id = rvh_a->GetRoutingID();
-
std::string script =
"window.onunload = function() { "
" var start = Date.now();"
@@ -4189,14 +4183,15 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
"}";
EXPECT_TRUE(ExecuteScript(shell()->web_contents(), script));
+ // Navigating cross-site with an iframe to the original site shouldn't crash.
GURL second_url(embedded_test_server()->GetURL(
"b.com", "/cross_site_iframe_factory.html?b(a)"));
EXPECT_TRUE(NavigateToURL(shell(), second_url));
- // We should have a different RVH for a.com.
- RenderViewHostImpl* rvh_a2 =
- root->child_at(0)->current_frame_host()->render_view_host();
- EXPECT_NE(rvh_a_routing_id, rvh_a2->GetRoutingID());
+ // If the subframe is created while the main frame is pending deletion, then
+ // the RVH will be different.
+ // TODO(creis, alexmos): Find a way to assert this that isn't flaky. For now,
+ // the test is just likely (not certain) to catch regressions by crashing.
}
// Check that when a cross-process frame acquires focus, the old focused frame
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698