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

Unified Diff: chrome/browser/site_per_process_interactive_browsertest.cc

Issue 2112923002: Fix crash when destroying a RenderWidgetHost that holds the pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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 | content/browser/frame_host/cross_process_frame_connector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/site_per_process_interactive_browsertest.cc
diff --git a/chrome/browser/site_per_process_interactive_browsertest.cc b/chrome/browser/site_per_process_interactive_browsertest.cc
index c063ef805fb898a86ef14784d33f07679e2c7d4d..9c105d7c029a4926584f89cc5cd594e4b7693cfe 100644
--- a/chrome/browser/site_per_process_interactive_browsertest.cc
+++ b/chrome/browser/site_per_process_interactive_browsertest.cc
@@ -741,3 +741,32 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
EXPECT_FALSE(ElementHasFullscreenStyle(c_middle, "child-0"));
}
+// Test that deleting a RenderWidgetHost that holds the mouse lock won't cause a
+// crash. https://crbug.com/619571.
+IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest,
+ RenderWidgetHostDeletedWhileMouseLocked) {
+ GURL main_url(embedded_test_server()->GetURL(
+ "a.com", "/cross_site_iframe_factory.html?a(b)"));
+ ui_test_utils::NavigateToURL(browser(), main_url);
+
+ content::WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ content::RenderFrameHost* main_frame = web_contents->GetMainFrame();
+ content::RenderFrameHost* child = ChildFrameAt(main_frame, 0);
+
+ EXPECT_TRUE(ExecuteScript(child, "document.body.requestPointerLock()"));
+ bool mouse_locked = false;
+ EXPECT_TRUE(ExecuteScriptAndExtractBool(child,
+ "window.domAutomationController.send("
+ "document.body == "
+ "document.pointerLockElement)",
+ &mouse_locked));
+ EXPECT_TRUE(mouse_locked);
+ EXPECT_TRUE(main_frame->GetView()->IsMouseLocked());
+
+ EXPECT_TRUE(ExecuteScript(main_frame,
+ "document.querySelector('iframe').parentNode."
+ "removeChild(document.querySelector('iframe'))"));
+ EXPECT_FALSE(main_frame->GetView()->IsMouseLocked());
+}
« no previous file with comments | « no previous file | content/browser/frame_host/cross_process_frame_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698