OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 64 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
65 #include "chrome/common/chrome_paths.h" | 65 #include "chrome/common/chrome_paths.h" |
66 #include "chrome/common/chrome_switches.h" | 66 #include "chrome/common/chrome_switches.h" |
67 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 67 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
68 #include "chrome/common/pref_names.h" | 68 #include "chrome/common/pref_names.h" |
69 #include "chrome/common/url_constants.h" | 69 #include "chrome/common/url_constants.h" |
70 #include "chrome/grit/chromium_strings.h" | 70 #include "chrome/grit/chromium_strings.h" |
71 #include "chrome/grit/generated_resources.h" | 71 #include "chrome/grit/generated_resources.h" |
72 #include "chrome/test/base/in_process_browser_test.h" | 72 #include "chrome/test/base/in_process_browser_test.h" |
73 #include "chrome/test/base/ui_test_utils.h" | 73 #include "chrome/test/base/ui_test_utils.h" |
74 #include "components/app_modal/app_modal_dialog.h" | |
75 #include "components/app_modal/app_modal_dialog_queue.h" | 74 #include "components/app_modal/app_modal_dialog_queue.h" |
76 #include "components/app_modal/javascript_app_modal_dialog.h" | 75 #include "components/app_modal/javascript_app_modal_dialog.h" |
77 #include "components/app_modal/native_app_modal_dialog.h" | 76 #include "components/app_modal/native_app_modal_dialog.h" |
78 #include "components/content_settings/core/browser/host_content_settings_map.h" | 77 #include "components/content_settings/core/browser/host_content_settings_map.h" |
79 #include "components/omnibox/common/omnibox_focus_state.h" | 78 #include "components/omnibox/common/omnibox_focus_state.h" |
80 #include "components/prefs/pref_service.h" | 79 #include "components/prefs/pref_service.h" |
81 #include "components/sessions/core/base_session_service_test_helper.h" | 80 #include "components/sessions/core/base_session_service_test_helper.h" |
82 #include "components/translate/core/browser/language_state.h" | 81 #include "components/translate/core/browser/language_state.h" |
83 #include "components/translate/core/common/language_detection_details.h" | 82 #include "components/translate/core/common/language_detection_details.h" |
84 #include "content/public/browser/favicon_status.h" | 83 #include "content/public/browser/favicon_status.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 #if defined(OS_MACOSX) | 119 #if defined(OS_MACOSX) |
121 #include "base/mac/scoped_nsautorelease_pool.h" | 120 #include "base/mac/scoped_nsautorelease_pool.h" |
122 #include "chrome/browser/ui/cocoa/test/run_loop_testing.h" | 121 #include "chrome/browser/ui/cocoa/test/run_loop_testing.h" |
123 #endif | 122 #endif |
124 | 123 |
125 #if defined(OS_WIN) | 124 #if defined(OS_WIN) |
126 #include "base/i18n/rtl.h" | 125 #include "base/i18n/rtl.h" |
127 #include "chrome/browser/browser_process.h" | 126 #include "chrome/browser/browser_process.h" |
128 #endif | 127 #endif |
129 | 128 |
130 using app_modal::AppModalDialog; | |
131 using app_modal::AppModalDialogQueue; | 129 using app_modal::AppModalDialogQueue; |
132 using app_modal::JavaScriptAppModalDialog; | 130 using app_modal::JavaScriptAppModalDialog; |
133 using base::ASCIIToUTF16; | 131 using base::ASCIIToUTF16; |
134 using content::InterstitialPage; | 132 using content::InterstitialPage; |
135 using content::HostZoomMap; | 133 using content::HostZoomMap; |
136 using content::NavigationController; | 134 using content::NavigationController; |
137 using content::NavigationEntry; | 135 using content::NavigationEntry; |
138 using content::OpenURLParams; | 136 using content::OpenURLParams; |
139 using content::Referrer; | 137 using content::Referrer; |
140 using content::WebContents; | 138 using content::WebContents; |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 IN_PROC_BROWSER_TEST_F(BrowserTest, SadTabCancelsDialogs) { | 608 IN_PROC_BROWSER_TEST_F(BrowserTest, SadTabCancelsDialogs) { |
611 ASSERT_TRUE(embedded_test_server()->Start()); | 609 ASSERT_TRUE(embedded_test_server()->Start()); |
612 GURL beforeunload_url(embedded_test_server()->GetURL("/beforeunload.html")); | 610 GURL beforeunload_url(embedded_test_server()->GetURL("/beforeunload.html")); |
613 ui_test_utils::NavigateToURL(browser(), beforeunload_url); | 611 ui_test_utils::NavigateToURL(browser(), beforeunload_url); |
614 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 612 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
615 content::PrepContentsForBeforeUnloadTest(contents); | 613 content::PrepContentsForBeforeUnloadTest(contents); |
616 | 614 |
617 // Start a navigation to trigger the beforeunload dialog. | 615 // Start a navigation to trigger the beforeunload dialog. |
618 contents->GetMainFrame()->ExecuteJavaScriptForTests( | 616 contents->GetMainFrame()->ExecuteJavaScriptForTests( |
619 ASCIIToUTF16("window.location.href = 'about:blank'")); | 617 ASCIIToUTF16("window.location.href = 'about:blank'")); |
620 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 618 JavaScriptAppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
621 EXPECT_TRUE(alert->IsValid()); | 619 EXPECT_TRUE(alert->IsValid()); |
622 AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance(); | 620 AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance(); |
623 EXPECT_TRUE(dialog_queue->HasActiveDialog()); | 621 EXPECT_TRUE(dialog_queue->HasActiveDialog()); |
624 | 622 |
625 // Crash the renderer process and ensure the dialog is gone. | 623 // Crash the renderer process and ensure the dialog is gone. |
626 content::RenderProcessHost* child_process = contents->GetRenderProcessHost(); | 624 content::RenderProcessHost* child_process = contents->GetRenderProcessHost(); |
627 content::RenderProcessHostWatcher crash_observer( | 625 content::RenderProcessHostWatcher crash_observer( |
628 child_process, | 626 child_process, |
629 content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 627 content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
630 child_process->Shutdown(0, false); | 628 child_process->Shutdown(0, false); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 // then canceling the dialog should not leave the throbber spinning. | 699 // then canceling the dialog should not leave the throbber spinning. |
702 IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) { | 700 IN_PROC_BROWSER_TEST_F(BrowserTest, ReloadThenCancelBeforeUnload) { |
703 GURL url(std::string("data:text/html,") + kBeforeUnloadHTML); | 701 GURL url(std::string("data:text/html,") + kBeforeUnloadHTML); |
704 ui_test_utils::NavigateToURL(browser(), url); | 702 ui_test_utils::NavigateToURL(browser(), url); |
705 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 703 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
706 content::PrepContentsForBeforeUnloadTest(contents); | 704 content::PrepContentsForBeforeUnloadTest(contents); |
707 | 705 |
708 // Navigate to another page, but click cancel in the dialog. Make sure that | 706 // Navigate to another page, but click cancel in the dialog. Make sure that |
709 // the throbber stops spinning. | 707 // the throbber stops spinning. |
710 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); | 708 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
711 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 709 JavaScriptAppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
712 | 710 |
713 alert->CloseModalDialog(); | 711 alert->CloseModalDialog(); |
714 EXPECT_FALSE(contents->IsLoading()); | 712 EXPECT_FALSE(contents->IsLoading()); |
715 | 713 |
716 // Clear the beforeunload handler so the test can easily exit. | 714 // Clear the beforeunload handler so the test can easily exit. |
717 contents->GetMainFrame()->ExecuteJavaScriptForTests( | 715 contents->GetMainFrame()->ExecuteJavaScriptForTests( |
718 ASCIIToUTF16("onbeforeunload=null;")); | 716 ASCIIToUTF16("onbeforeunload=null;")); |
719 } | 717 } |
720 | 718 |
721 class RedirectObserver : public content::WebContentsObserver { | 719 class RedirectObserver : public content::WebContentsObserver { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 // beforeunload dialog that pops up. | 826 // beforeunload dialog that pops up. |
829 content::WindowedNotificationObserver nav_observer( | 827 content::WindowedNotificationObserver nav_observer( |
830 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 828 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
831 content::NotificationService::AllSources()); | 829 content::NotificationService::AllSources()); |
832 GURL https_url(https_test_server.GetURL("/title1.html")); | 830 GURL https_url(https_test_server.GetURL("/title1.html")); |
833 GURL redirect_url( | 831 GURL redirect_url( |
834 embedded_test_server()->GetURL("/server-redirect?" + https_url.spec())); | 832 embedded_test_server()->GetURL("/server-redirect?" + https_url.spec())); |
835 browser()->OpenURL(OpenURLParams(redirect_url, Referrer(), | 833 browser()->OpenURL(OpenURLParams(redirect_url, Referrer(), |
836 WindowOpenDisposition::CURRENT_TAB, | 834 WindowOpenDisposition::CURRENT_TAB, |
837 ui::PAGE_TRANSITION_TYPED, false)); | 835 ui::PAGE_TRANSITION_TYPED, false)); |
838 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 836 JavaScriptAppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
839 EXPECT_TRUE( | 837 EXPECT_TRUE(alert->is_before_unload_dialog()); |
840 static_cast<JavaScriptAppModalDialog*>(alert)->is_before_unload_dialog()); | |
841 alert->native_dialog()->AcceptAppModalDialog(); | 838 alert->native_dialog()->AcceptAppModalDialog(); |
842 nav_observer.Wait(); | 839 nav_observer.Wait(); |
843 | 840 |
844 // Restore previous browser client. | 841 // Restore previous browser client. |
845 SetBrowserClientForTesting(old_client); | 842 SetBrowserClientForTesting(old_client); |
846 } | 843 } |
847 | 844 |
848 // Test for crbug.com/80401. Canceling a before unload dialog should reset | 845 // Test for crbug.com/80401. Canceling a before unload dialog should reset |
849 // the URL to the previous page's URL. | 846 // the URL to the previous page's URL. |
850 IN_PROC_BROWSER_TEST_F(BrowserTest, CancelBeforeUnloadResetsURL) { | 847 IN_PROC_BROWSER_TEST_F(BrowserTest, CancelBeforeUnloadResetsURL) { |
851 GURL url(ui_test_utils::GetTestUrl(base::FilePath( | 848 GURL url(ui_test_utils::GetTestUrl(base::FilePath( |
852 base::FilePath::kCurrentDirectory), base::FilePath(kBeforeUnloadFile))); | 849 base::FilePath::kCurrentDirectory), base::FilePath(kBeforeUnloadFile))); |
853 ui_test_utils::NavigateToURL(browser(), url); | 850 ui_test_utils::NavigateToURL(browser(), url); |
854 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 851 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
855 content::PrepContentsForBeforeUnloadTest(contents); | 852 content::PrepContentsForBeforeUnloadTest(contents); |
856 | 853 |
857 // Navigate to a page that triggers a cross-site transition. | 854 // Navigate to a page that triggers a cross-site transition. |
858 ASSERT_TRUE(embedded_test_server()->Start()); | 855 ASSERT_TRUE(embedded_test_server()->Start()); |
859 GURL url2(embedded_test_server()->GetURL("/title1.html")); | 856 GURL url2(embedded_test_server()->GetURL("/title1.html")); |
860 browser()->OpenURL(OpenURLParams(url2, Referrer(), | 857 browser()->OpenURL(OpenURLParams(url2, Referrer(), |
861 WindowOpenDisposition::CURRENT_TAB, | 858 WindowOpenDisposition::CURRENT_TAB, |
862 ui::PAGE_TRANSITION_TYPED, false)); | 859 ui::PAGE_TRANSITION_TYPED, false)); |
863 | 860 |
864 content::WindowedNotificationObserver host_destroyed_observer( | 861 content::WindowedNotificationObserver host_destroyed_observer( |
865 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, | 862 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, |
866 content::NotificationService::AllSources()); | 863 content::NotificationService::AllSources()); |
867 | 864 |
868 // Cancel the dialog. | 865 // Cancel the dialog. |
869 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 866 JavaScriptAppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
870 alert->CloseModalDialog(); | 867 alert->CloseModalDialog(); |
871 EXPECT_FALSE(contents->IsLoading()); | 868 EXPECT_FALSE(contents->IsLoading()); |
872 | 869 |
873 // Verify there are no pending history items after the dialog is cancelled. | 870 // Verify there are no pending history items after the dialog is cancelled. |
874 // (see crbug.com/93858) | 871 // (see crbug.com/93858) |
875 NavigationEntry* entry = contents->GetController().GetPendingEntry(); | 872 NavigationEntry* entry = contents->GetController().GetPendingEntry(); |
876 EXPECT_EQ(NULL, entry); | 873 EXPECT_EQ(NULL, entry); |
877 | 874 |
878 // Wait for the ShouldClose_ACK to arrive. We can detect it by waiting for | 875 // Wait for the ShouldClose_ACK to arrive. We can detect it by waiting for |
879 // the pending RVH to be destroyed. | 876 // the pending RVH to be destroyed. |
(...skipping 19 matching lines...) Expand all Loading... |
899 | 896 |
900 // Close the new window with JavaScript, which should show a single | 897 // Close the new window with JavaScript, which should show a single |
901 // beforeunload dialog. Then show another alert, to make it easy to verify | 898 // beforeunload dialog. Then show another alert, to make it easy to verify |
902 // that a second beforeunload dialog isn't shown. | 899 // that a second beforeunload dialog isn't shown. |
903 browser() | 900 browser() |
904 ->tab_strip_model() | 901 ->tab_strip_model() |
905 ->GetWebContentsAt(0) | 902 ->GetWebContentsAt(0) |
906 ->GetMainFrame() | 903 ->GetMainFrame() |
907 ->ExecuteJavaScriptWithUserGestureForTests( | 904 ->ExecuteJavaScriptWithUserGestureForTests( |
908 ASCIIToUTF16("w.close(); alert('bar');")); | 905 ASCIIToUTF16("w.close(); alert('bar');")); |
909 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 906 JavaScriptAppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
910 alert->native_dialog()->AcceptAppModalDialog(); | 907 alert->native_dialog()->AcceptAppModalDialog(); |
911 | 908 |
912 alert = ui_test_utils::WaitForAppModalDialog(); | 909 alert = ui_test_utils::WaitForAppModalDialog(); |
913 EXPECT_FALSE(static_cast<JavaScriptAppModalDialog*>(alert)-> | 910 EXPECT_FALSE(alert->is_before_unload_dialog()); |
914 is_before_unload_dialog()); | |
915 alert->native_dialog()->AcceptAppModalDialog(); | 911 alert->native_dialog()->AcceptAppModalDialog(); |
916 } | 912 } |
917 | 913 |
918 // Test that when a page has an onbeforeunload handler, reloading a page shows a | 914 // Test that when a page has an onbeforeunload handler, reloading a page shows a |
919 // different dialog than navigating to a different page. | 915 // different dialog than navigating to a different page. |
920 IN_PROC_BROWSER_TEST_F(BrowserTest, BeforeUnloadVsBeforeReload) { | 916 IN_PROC_BROWSER_TEST_F(BrowserTest, BeforeUnloadVsBeforeReload) { |
921 GURL url(std::string("data:text/html,") + kBeforeUnloadHTML); | 917 GURL url(std::string("data:text/html,") + kBeforeUnloadHTML); |
922 ui_test_utils::NavigateToURL(browser(), url); | 918 ui_test_utils::NavigateToURL(browser(), url); |
923 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); | 919 WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents(); |
924 content::PrepContentsForBeforeUnloadTest(contents); | 920 content::PrepContentsForBeforeUnloadTest(contents); |
925 | 921 |
926 // Reload the page, and check that we get a "before reload" dialog. | 922 // Reload the page, and check that we get a "before reload" dialog. |
927 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); | 923 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
928 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 924 JavaScriptAppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
929 EXPECT_TRUE(static_cast<JavaScriptAppModalDialog*>(alert)->is_reload()); | 925 EXPECT_TRUE(alert->is_reload()); |
930 | 926 |
931 // Proceed with the reload. | 927 // Proceed with the reload. |
932 alert->native_dialog()->AcceptAppModalDialog(); | 928 alert->native_dialog()->AcceptAppModalDialog(); |
933 EXPECT_TRUE(content::WaitForLoadStop(contents)); | 929 EXPECT_TRUE(content::WaitForLoadStop(contents)); |
934 | 930 |
935 content::PrepContentsForBeforeUnloadTest(contents); | 931 content::PrepContentsForBeforeUnloadTest(contents); |
936 | 932 |
937 // Navigate to another url, and check that we get a "before unload" dialog. | 933 // Navigate to another url, and check that we get a "before unload" dialog. |
938 GURL url2(url::kAboutBlankURL); | 934 GURL url2(url::kAboutBlankURL); |
939 browser()->OpenURL(OpenURLParams(url2, Referrer(), | 935 browser()->OpenURL(OpenURLParams(url2, Referrer(), |
940 WindowOpenDisposition::CURRENT_TAB, | 936 WindowOpenDisposition::CURRENT_TAB, |
941 ui::PAGE_TRANSITION_TYPED, false)); | 937 ui::PAGE_TRANSITION_TYPED, false)); |
942 | 938 |
943 alert = ui_test_utils::WaitForAppModalDialog(); | 939 alert = ui_test_utils::WaitForAppModalDialog(); |
944 EXPECT_FALSE(static_cast<JavaScriptAppModalDialog*>(alert)->is_reload()); | 940 EXPECT_FALSE(alert->is_reload()); |
945 | 941 |
946 // Accept the navigation so we end up on a page without a beforeunload hook. | 942 // Accept the navigation so we end up on a page without a beforeunload hook. |
947 alert->native_dialog()->AcceptAppModalDialog(); | 943 alert->native_dialog()->AcceptAppModalDialog(); |
948 } | 944 } |
949 | 945 |
950 // BeforeUnloadAtQuitWithTwoWindows is a regression test for | 946 // BeforeUnloadAtQuitWithTwoWindows is a regression test for |
951 // http://crbug.com/11842. It opens two windows, one of which has a | 947 // http://crbug.com/11842. It opens two windows, one of which has a |
952 // beforeunload handler and attempts to exit cleanly. | 948 // beforeunload handler and attempts to exit cleanly. |
953 class BeforeUnloadAtQuitWithTwoWindows : public InProcessBrowserTest { | 949 class BeforeUnloadAtQuitWithTwoWindows : public InProcessBrowserTest { |
954 public: | 950 public: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 // platform, though, it exits unconditionally. See the comment and bug ID | 1002 // platform, though, it exits unconditionally. See the comment and bug ID |
1007 // in AttemptUserExit() in application_lifetime.cc. | 1003 // in AttemptUserExit() in application_lifetime.cc. |
1008 #if defined(OS_CHROMEOS) | 1004 #if defined(OS_CHROMEOS) |
1009 chrome::AttemptExit(); | 1005 chrome::AttemptExit(); |
1010 #else | 1006 #else |
1011 chrome::ExecuteCommand(second_window, IDC_EXIT); | 1007 chrome::ExecuteCommand(second_window, IDC_EXIT); |
1012 #endif | 1008 #endif |
1013 | 1009 |
1014 // The beforeunload handler will run at exit, ensure it does, and then accept | 1010 // The beforeunload handler will run at exit, ensure it does, and then accept |
1015 // it to allow shutdown to proceed. | 1011 // it to allow shutdown to proceed. |
1016 AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); | 1012 JavaScriptAppModalDialog* alert = ui_test_utils::WaitForAppModalDialog(); |
1017 ASSERT_TRUE(alert); | 1013 ASSERT_TRUE(alert); |
1018 EXPECT_TRUE( | 1014 EXPECT_TRUE(alert->is_before_unload_dialog()); |
1019 static_cast<JavaScriptAppModalDialog*>(alert)->is_before_unload_dialog()); | |
1020 alert->native_dialog()->AcceptAppModalDialog(); | 1015 alert->native_dialog()->AcceptAppModalDialog(); |
1021 | 1016 |
1022 // But wait there's more! If this test times out, it likely means that the | 1017 // But wait there's more! If this test times out, it likely means that the |
1023 // browser has not been able to quit correctly, indicating there's a | 1018 // browser has not been able to quit correctly, indicating there's a |
1024 // regression of the bug noted above. | 1019 // regression of the bug noted above. |
1025 } | 1020 } |
1026 | 1021 |
1027 // Test that scripts can fork a new renderer process for a cross-site popup, | 1022 // Test that scripts can fork a new renderer process for a cross-site popup, |
1028 // based on http://www.google.com/chrome/intl/en/webmasters-faq.html#newtab. | 1023 // based on http://www.google.com/chrome/intl/en/webmasters-faq.html#newtab. |
1029 // The script must open a new tab, set its window.opener to null, and navigate | 1024 // The script must open a new tab, set its window.opener to null, and navigate |
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2851 Browser* browser = new Browser(params); | 2846 Browser* browser = new Browser(params); |
2852 gfx::Rect bounds = browser->window()->GetBounds(); | 2847 gfx::Rect bounds = browser->window()->GetBounds(); |
2853 | 2848 |
2854 // Should be EXPECT_EQ, but this width is inconsistent across platforms. | 2849 // Should be EXPECT_EQ, but this width is inconsistent across platforms. |
2855 // See https://crbug.com/567925. | 2850 // See https://crbug.com/567925. |
2856 EXPECT_GE(bounds.width(), 100); | 2851 EXPECT_GE(bounds.width(), 100); |
2857 EXPECT_EQ(122, bounds.height()); | 2852 EXPECT_EQ(122, bounds.height()); |
2858 browser->window()->Close(); | 2853 browser->window()->Close(); |
2859 } | 2854 } |
2860 } | 2855 } |
OLD | NEW |