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

Unified Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 659293002: Make sure new render is used when navigating away from about:blank in WebUI renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved the implementation to the better places pointed out and addressed other comments. Created 6 years, 2 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/frame_host/render_frame_host_manager_browsertest.cc
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
index 18b5a68784c3e95a39efbed16264505a175c9dec..8e85de073a6b19112f3236a6201877e46ff3c2af 100644
--- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -1473,4 +1473,27 @@ IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest, WebUIGetsBindings) {
new_web_contents->GetRenderViewHost()->GetEnabledBindings());
}
+// crbug.com/424526
+// The test loads WebUI page, then navigates to blank page and to the regular
Charlie Reis 2014/10/21 19:10:41 nit: loads a WebUI page in --process-per-tab mode,
Krzysztof Olczyk 2014/10/22 06:24:05 Done.
+// page, consecutively. The bug reproduces if blank page is navigated in between
Charlie Reis 2014/10/21 19:10:42 nit: navigated -> visited
Krzysztof Olczyk 2014/10/22 06:24:05 Done.
+// WebUI and regular page.
+IN_PROC_BROWSER_TEST_F(RenderFrameHostManagerTest,
+ ForceSwapAfterWebUIBindings) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(switches::kProcessPerTab);
+ ASSERT_TRUE(test_server()->Start());
+
+ const GURL web_ui_url(std::string(kChromeUIScheme) + "://" +
+ std::string(kChromeUIGpuHost));
+ NavigateToURL(shell(), web_ui_url);
+ EXPECT_TRUE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
+ shell()->web_contents()->GetRenderProcessHost()->GetID()));
+
+ NavigateToURL(shell(), GURL(url::kAboutBlankURL));
+
+ GURL regular_page_url(test_server()->GetURL("files/title2.html"));
+ NavigateToURL(shell(), regular_page_url);
+ EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings(
+ shell()->web_contents()->GetRenderProcessHost()->GetID()));
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698