OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" | 9 #include "chrome/browser/ui/exclusive_access/fullscreen_controller_test.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 // Verify that all fullscreen styles have been cleared. | 734 // Verify that all fullscreen styles have been cleared. |
735 EXPECT_FALSE(ElementHasFullscreenStyle(a_top, "child-0")); | 735 EXPECT_FALSE(ElementHasFullscreenStyle(a_top, "child-0")); |
736 EXPECT_FALSE(ElementHasFullscreenStyle(a_bottom, "child-0")); | 736 EXPECT_FALSE(ElementHasFullscreenStyle(a_bottom, "child-0")); |
737 EXPECT_FALSE(ElementHasFullscreenStyle(a_bottom, "child-1")); | 737 EXPECT_FALSE(ElementHasFullscreenStyle(a_bottom, "child-1")); |
738 EXPECT_FALSE(ElementHasFullscreenStyle(b_second, "child-0")); | 738 EXPECT_FALSE(ElementHasFullscreenStyle(b_second, "child-0")); |
739 EXPECT_FALSE(ElementHasFullscreenStyle(c_top, "child-0")); | 739 EXPECT_FALSE(ElementHasFullscreenStyle(c_top, "child-0")); |
740 EXPECT_FALSE(ElementHasFullscreenStyle(c_middle, "fullscreen-div")); | 740 EXPECT_FALSE(ElementHasFullscreenStyle(c_middle, "fullscreen-div")); |
741 EXPECT_FALSE(ElementHasFullscreenStyle(c_middle, "child-0")); | 741 EXPECT_FALSE(ElementHasFullscreenStyle(c_middle, "child-0")); |
742 } | 742 } |
743 | 743 |
| 744 // Test that deleting a RenderWidgetHost that holds the mouse lock won't cause a |
| 745 // crash. https://crbug.com/619571. |
| 746 IN_PROC_BROWSER_TEST_F(SitePerProcessInteractiveBrowserTest, |
| 747 RenderWidgetHostDeletedWhileMouseLocked) { |
| 748 GURL main_url(embedded_test_server()->GetURL( |
| 749 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
| 750 ui_test_utils::NavigateToURL(browser(), main_url); |
| 751 |
| 752 content::WebContents* web_contents = |
| 753 browser()->tab_strip_model()->GetActiveWebContents(); |
| 754 |
| 755 content::RenderFrameHost* main_frame = web_contents->GetMainFrame(); |
| 756 content::RenderFrameHost* child = ChildFrameAt(main_frame, 0); |
| 757 |
| 758 EXPECT_TRUE(ExecuteScript(child, "document.body.requestPointerLock()")); |
| 759 bool mouse_locked = false; |
| 760 EXPECT_TRUE(ExecuteScriptAndExtractBool(child, |
| 761 "window.domAutomationController.send(" |
| 762 "document.body == " |
| 763 "document.pointerLockElement)", |
| 764 &mouse_locked)); |
| 765 EXPECT_TRUE(mouse_locked); |
| 766 EXPECT_TRUE(main_frame->GetView()->IsMouseLocked()); |
| 767 |
| 768 EXPECT_TRUE(ExecuteScript(main_frame, |
| 769 "document.querySelector('iframe').parentNode." |
| 770 "removeChild(document.querySelector('iframe'))")); |
| 771 EXPECT_FALSE(main_frame->GetView()->IsMouseLocked()); |
| 772 } |
OLD | NEW |