OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ash/scoped_target_root_window.h" | 5 #include "ash/scoped_target_root_window.h" |
6 #include "ash/screen_util.h" | 6 #include "ash/screen_util.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ash/test/test_shell_delegate.h" | 9 #include "ash/test/test_shell_delegate.h" |
10 #include "ash/wm/window_positioner.h" | 10 #include "ash/wm/window_positioner.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // On desktop linux aura, we currently don't use the ash frame, breaking some | 462 // On desktop linux aura, we currently don't use the ash frame, breaking some |
463 // tests which expect ash sizes: http://crbug.com/303862 | 463 // tests which expect ash sizes: http://crbug.com/303862 |
464 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 464 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
465 #define MAYBE_PlaceNewWindows DISABLED_PlaceNewWindows | 465 #define MAYBE_PlaceNewWindows DISABLED_PlaceNewWindows |
466 #else | 466 #else |
467 #define MAYBE_PlaceNewWindows PlaceNewWindows | 467 #define MAYBE_PlaceNewWindows PlaceNewWindows |
468 #endif | 468 #endif |
469 | 469 |
470 // Test the placement of newly created windows. | 470 // Test the placement of newly created windows. |
471 TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindows) { | 471 TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindows) { |
472 // Create a browser which we can use to pass into the GetWindowBounds | 472 // Create a browser to pass into the GetWindowBounds function. |
473 // function. | |
474 scoped_ptr<TestingProfile> profile(new TestingProfile()); | 473 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
475 // Creating a popup handler here to make sure it does not interfere with the | 474 // Creating a popup handler here to make sure it does not interfere with the |
476 // existing windows. | 475 // existing windows. |
477 Browser::CreateParams native_params(profile.get(), | 476 Browser::CreateParams native_params(profile.get(), |
478 chrome::HOST_DESKTOP_TYPE_ASH); | 477 chrome::HOST_DESKTOP_TYPE_ASH); |
479 scoped_ptr<Browser> browser( | 478 scoped_ptr<Browser> browser( |
480 chrome::CreateBrowserWithTestWindowForParams(&native_params)); | 479 chrome::CreateBrowserWithTestWindowForParams(&native_params)); |
481 | 480 |
482 // Creating a popup handler here to make sure it does not interfere with the | 481 // Creating a popup handler here to make sure it does not interfere with the |
483 // existing windows. | 482 // existing windows. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 541 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
543 #define MAYBE_PlaceNewBrowserWindowOnEmptyDesktop DISABLED_PlaceNewBrowserWindow
OnEmptyDesktop | 542 #define MAYBE_PlaceNewBrowserWindowOnEmptyDesktop DISABLED_PlaceNewBrowserWindow
OnEmptyDesktop |
544 #else | 543 #else |
545 #define MAYBE_PlaceNewBrowserWindowOnEmptyDesktop PlaceNewBrowserWindowOnEmptyDe
sktop | 544 #define MAYBE_PlaceNewBrowserWindowOnEmptyDesktop PlaceNewBrowserWindowOnEmptyDe
sktop |
546 #endif | 545 #endif |
547 | 546 |
548 // Test the placement of newly created windows on an empty desktop. | 547 // Test the placement of newly created windows on an empty desktop. |
549 // This test supplements "PlaceNewWindows" by testing the creation of a newly | 548 // This test supplements "PlaceNewWindows" by testing the creation of a newly |
550 // created browser window on an empty desktop. | 549 // created browser window on an empty desktop. |
551 TEST_F(WindowSizerAshTest, MAYBE_PlaceNewBrowserWindowOnEmptyDesktop) { | 550 TEST_F(WindowSizerAshTest, MAYBE_PlaceNewBrowserWindowOnEmptyDesktop) { |
552 // Create a browser which we can use to pass into the GetWindowBounds | 551 // Create a browser to pass into the GetWindowBoundsAndShowState function. |
553 // function. | |
554 scoped_ptr<TestingProfile> profile(new TestingProfile()); | 552 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
555 Browser::CreateParams native_params(profile.get(), | 553 Browser::CreateParams native_params(profile.get(), |
556 chrome::HOST_DESKTOP_TYPE_ASH); | 554 chrome::HOST_DESKTOP_TYPE_ASH); |
557 scoped_ptr<Browser> browser( | 555 scoped_ptr<Browser> browser( |
558 chrome::CreateBrowserWithTestWindowForParams(&native_params)); | 556 chrome::CreateBrowserWithTestWindowForParams(&native_params)); |
559 | 557 |
560 // A common screen size for Chrome OS devices where this behavior is | 558 // A common screen size for Chrome OS devices where this behavior is |
561 // desirable. | 559 // desirable. |
562 const gfx::Rect p1366x768(0, 0, 1366, 768); | 560 const gfx::Rect p1366x768(0, 0, 1366, 768); |
563 | 561 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 Browser::CreateParams(Browser::TYPE_POPUP, profile.get(), | 743 Browser::CreateParams(Browser::TYPE_POPUP, profile.get(), |
746 chrome::HOST_DESKTOP_TYPE_ASH))); | 744 chrome::HOST_DESKTOP_TYPE_ASH))); |
747 | 745 |
748 // Tabbed windows should retrieve the saved window state - since there is a | 746 // Tabbed windows should retrieve the saved window state - since there is a |
749 // top window. | 747 // top window. |
750 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, | 748 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, |
751 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 749 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
752 ui::SHOW_STATE_NORMAL, | 750 ui::SHOW_STATE_NORMAL, |
753 BOTH, | 751 BOTH, |
754 browser_window->browser(), | 752 browser_window->browser(), |
| 753 p1600x1200, |
755 p1600x1200)); | 754 p1600x1200)); |
| 755 // A window that is smaller than the whole work area is set to default state. |
756 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, | 756 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
757 GetWindowShowState(ui::SHOW_STATE_DEFAULT, | 757 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
758 ui::SHOW_STATE_NORMAL, | 758 ui::SHOW_STATE_NORMAL, |
759 BOTH, | 759 BOTH, |
760 browser_window->browser(), | 760 browser_window->browser(), |
| 761 p1280x1024, |
| 762 p1600x1200)); |
| 763 // A window that is sized to occupy the whole work area is maximized. |
| 764 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, |
| 765 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
| 766 ui::SHOW_STATE_NORMAL, |
| 767 BOTH, |
| 768 browser_window->browser(), |
| 769 p1600x1200, |
761 p1600x1200)); | 770 p1600x1200)); |
762 // Non tabbed windows should always follow the window saved visibility state. | 771 // Non tabbed windows should always follow the window saved visibility state. |
763 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, | 772 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, |
764 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 773 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
765 ui::SHOW_STATE_NORMAL, | 774 ui::SHOW_STATE_NORMAL, |
766 BOTH, | 775 BOTH, |
767 browser_popup->browser(), | 776 browser_popup->browser(), |
| 777 p1600x1200, |
768 p1600x1200)); | 778 p1600x1200)); |
769 // The non tabbed window will take the status of the last active of its kind. | 779 // The non tabbed window will take the status of the last active of its kind. |
770 EXPECT_EQ(ui::SHOW_STATE_NORMAL, | 780 EXPECT_EQ(ui::SHOW_STATE_NORMAL, |
771 GetWindowShowState(ui::SHOW_STATE_DEFAULT, | 781 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
772 ui::SHOW_STATE_NORMAL, | 782 ui::SHOW_STATE_NORMAL, |
773 BOTH, | 783 BOTH, |
774 browser_popup->browser(), | 784 browser_popup->browser(), |
| 785 p1600x1200, |
775 p1600x1200)); | 786 p1600x1200)); |
776 | 787 |
777 // Now create a top level window and check again for both. Only the tabbed | 788 // Now create a top level window and check again for both. Only the tabbed |
778 // window should follow the top level window's state. | 789 // window should follow the top level window's state. |
779 // Creating a browser & window to play with. | 790 // Creating a browser & window to play with. |
780 scoped_ptr<TestBrowserWindowAura> browser_window2(CreateTestBrowserWindow( | 791 scoped_ptr<TestBrowserWindowAura> browser_window2(CreateTestBrowserWindow( |
781 CreateTestWindowInShellWithId(3), | 792 CreateTestWindowInShellWithId(3), |
782 gfx::Rect(16, 32, 640, 320), | 793 gfx::Rect(16, 32, 640, 320), |
783 Browser::CreateParams(Browser::TYPE_TABBED, profile.get(), | 794 Browser::CreateParams(Browser::TYPE_TABBED, profile.get(), |
784 chrome::HOST_DESKTOP_TYPE_ASH))); | 795 chrome::HOST_DESKTOP_TYPE_ASH))); |
785 | 796 |
786 // A tabbed window should now take the top level window state. | 797 // A tabbed window should now take the top level window state. |
787 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, | 798 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
788 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 799 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
789 ui::SHOW_STATE_DEFAULT, | 800 ui::SHOW_STATE_DEFAULT, |
790 BOTH, | 801 BOTH, |
791 browser_window->browser(), | 802 browser_window->browser(), |
| 803 p1600x1200, |
792 p1600x1200)); | 804 p1600x1200)); |
793 // Non tabbed windows should always follow the window saved visibility state. | 805 // Non tabbed windows should always follow the window saved visibility state. |
794 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, | 806 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, |
795 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 807 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
796 ui::SHOW_STATE_MINIMIZED, | 808 ui::SHOW_STATE_MINIMIZED, |
797 BOTH, | 809 BOTH, |
798 browser_popup->browser(), | 810 browser_popup->browser(), |
| 811 p1600x1200, |
799 p1600x1200)); | 812 p1600x1200)); |
800 | 813 |
801 // In smaller screen resolutions we default to maximized if there is no other | 814 // In smaller screen resolutions we default to maximized if there is no other |
802 // window visible. | 815 // window visible. |
803 int min_size = ash::WindowPositioner::GetForceMaximizedWidthLimit() / 2; | 816 int min_size = ash::WindowPositioner::GetForceMaximizedWidthLimit() / 2; |
804 if (min_size > 0) { | 817 if (min_size > 0) { |
805 const gfx::Rect tiny_screen(0, 0, min_size, min_size); | 818 const gfx::Rect tiny_screen(0, 0, min_size, min_size); |
806 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, | 819 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
807 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 820 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
808 ui::SHOW_STATE_DEFAULT, | 821 ui::SHOW_STATE_DEFAULT, |
809 BOTH, | 822 BOTH, |
810 browser_window->browser(), | 823 browser_window->browser(), |
| 824 tiny_screen, |
811 tiny_screen)); | 825 tiny_screen)); |
812 browser_window->Hide(); | 826 browser_window->Hide(); |
813 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, | 827 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, |
814 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 828 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
815 ui::SHOW_STATE_DEFAULT, | 829 ui::SHOW_STATE_DEFAULT, |
816 BOTH, | 830 BOTH, |
817 browser_window2->browser(), | 831 browser_window2->browser(), |
| 832 tiny_screen, |
818 tiny_screen)); | 833 tiny_screen)); |
819 | 834 |
820 } | 835 } |
821 } | 836 } |
822 | 837 |
823 // Test that the default show state override behavior is properly handled. | 838 // Test that the default show state override behavior is properly handled. |
824 TEST_F(WindowSizerAshTest, TestShowStateDefaults) { | 839 TEST_F(WindowSizerAshTest, TestShowStateDefaults) { |
825 // Creating a browser & window to play with. | 840 // Creating a browser & window to play with. |
826 scoped_ptr<TestingProfile> profile(new TestingProfile()); | 841 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
827 | 842 |
(...skipping 11 matching lines...) Expand all Loading... |
839 Browser::CreateParams(Browser::TYPE_POPUP, profile.get(), | 854 Browser::CreateParams(Browser::TYPE_POPUP, profile.get(), |
840 chrome::HOST_DESKTOP_TYPE_ASH))); | 855 chrome::HOST_DESKTOP_TYPE_ASH))); |
841 | 856 |
842 // Check that a browser creation state always get used if not given as | 857 // Check that a browser creation state always get used if not given as |
843 // SHOW_STATE_DEFAULT. On Windows ASH it should be SHOW_STATE_MAXIMIZED. | 858 // SHOW_STATE_DEFAULT. On Windows ASH it should be SHOW_STATE_MAXIMIZED. |
844 ui::WindowShowState window_show_state = | 859 ui::WindowShowState window_show_state = |
845 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 860 GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
846 ui::SHOW_STATE_MAXIMIZED, | 861 ui::SHOW_STATE_MAXIMIZED, |
847 DEFAULT, | 862 DEFAULT, |
848 browser_window->browser(), | 863 browser_window->browser(), |
| 864 p1600x1200, |
849 p1600x1200); | 865 p1600x1200); |
850 #if defined(OS_WIN) | 866 #if defined(OS_WIN) |
851 EXPECT_EQ(window_show_state, ui::SHOW_STATE_MAXIMIZED); | 867 EXPECT_EQ(window_show_state, ui::SHOW_STATE_MAXIMIZED); |
852 #else | 868 #else |
853 EXPECT_EQ(window_show_state, ui::SHOW_STATE_DEFAULT); | 869 EXPECT_EQ(window_show_state, ui::SHOW_STATE_DEFAULT); |
854 #endif | 870 #endif |
855 | 871 |
856 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_MINIMIZED); | 872 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_MINIMIZED); |
857 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 873 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
858 ui::SHOW_STATE_MAXIMIZED, | 874 ui::SHOW_STATE_MAXIMIZED, |
859 BOTH, | 875 BOTH, |
860 browser_window->browser(), | 876 browser_window->browser(), |
| 877 p1600x1200, |
861 p1600x1200), ui::SHOW_STATE_MINIMIZED); | 878 p1600x1200), ui::SHOW_STATE_MINIMIZED); |
862 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_NORMAL); | 879 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_NORMAL); |
863 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, | 880 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_MAXIMIZED, |
864 ui::SHOW_STATE_MAXIMIZED, | 881 ui::SHOW_STATE_MAXIMIZED, |
865 BOTH, | 882 BOTH, |
866 browser_window->browser(), | 883 browser_window->browser(), |
| 884 p1600x1200, |
867 p1600x1200), ui::SHOW_STATE_NORMAL); | 885 p1600x1200), ui::SHOW_STATE_NORMAL); |
868 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_MAXIMIZED); | 886 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_MAXIMIZED); |
869 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, | 887 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, |
870 ui::SHOW_STATE_NORMAL, | 888 ui::SHOW_STATE_NORMAL, |
871 BOTH, | 889 BOTH, |
872 browser_window->browser(), | 890 browser_window->browser(), |
| 891 p1600x1200, |
873 p1600x1200), ui::SHOW_STATE_MAXIMIZED); | 892 p1600x1200), ui::SHOW_STATE_MAXIMIZED); |
874 | 893 |
875 // Check that setting the maximized command line option is forcing the | 894 // Check that setting the maximized command line option is forcing the |
876 // maximized state. | 895 // maximized state. |
877 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kStartMaximized); | 896 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kStartMaximized); |
878 | 897 |
879 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_NORMAL); | 898 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_NORMAL); |
880 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, | 899 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, |
881 ui::SHOW_STATE_NORMAL, | 900 ui::SHOW_STATE_NORMAL, |
882 BOTH, | 901 BOTH, |
883 browser_window->browser(), | 902 browser_window->browser(), |
| 903 p1600x1200, |
884 p1600x1200), ui::SHOW_STATE_MAXIMIZED); | 904 p1600x1200), ui::SHOW_STATE_MAXIMIZED); |
885 | 905 |
886 // The popup should favor the initial show state over the command line. | 906 // The popup should favor the initial show state over the command line. |
887 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, | 907 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, |
888 ui::SHOW_STATE_NORMAL, | 908 ui::SHOW_STATE_NORMAL, |
889 BOTH, | 909 BOTH, |
890 browser_popup->browser(), | 910 browser_popup->browser(), |
| 911 p1600x1200, |
891 p1600x1200), ui::SHOW_STATE_NORMAL); | 912 p1600x1200), ui::SHOW_STATE_NORMAL); |
892 } | 913 } |
893 | 914 |
894 // Test that the target root window is used as the destionation of | 915 TEST_F(WindowSizerAshTest, DefaultStateBecomesMaximized) { |
| 916 // Create a browser to pass into the GetWindowBounds function. |
| 917 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
| 918 Browser::CreateParams native_params(profile.get(), |
| 919 chrome::HOST_DESKTOP_TYPE_ASH); |
| 920 scoped_ptr<Browser> browser( |
| 921 chrome::CreateBrowserWithTestWindowForParams(&native_params)); |
| 922 |
| 923 gfx::Rect display_bounds = ash::Shell::GetInstance()->GetScreen()-> |
| 924 GetPrimaryDisplay().bounds(); |
| 925 gfx::Rect specified_bounds = display_bounds; |
| 926 |
| 927 // Make a window bigger than the display work area. |
| 928 specified_bounds.Inset(-20, -20); |
| 929 ui::WindowShowState show_state = ui::SHOW_STATE_DEFAULT; |
| 930 gfx::Rect bounds; |
| 931 WindowSizer::GetBrowserWindowBoundsAndShowState( |
| 932 std::string(), specified_bounds, browser.get(), &bounds, &show_state); |
| 933 // The window should start maximized with its restore bounds shrunken. |
| 934 EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, show_state); |
| 935 EXPECT_NE(display_bounds.ToString(), bounds.ToString()); |
| 936 EXPECT_TRUE(display_bounds.Contains(bounds)); |
| 937 |
| 938 // Make a window smaller than the display work area. |
| 939 specified_bounds.Inset(100, 100); |
| 940 show_state = ui::SHOW_STATE_DEFAULT; |
| 941 WindowSizer::GetBrowserWindowBoundsAndShowState( |
| 942 std::string(), specified_bounds, browser.get(), &bounds, &show_state); |
| 943 // The window should start in default state. |
| 944 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, show_state); |
| 945 EXPECT_EQ(specified_bounds.ToString(), bounds.ToString()); |
| 946 } |
| 947 |
| 948 // Test that the target root window is used as the destination of |
895 // the non browser window. This differ from PersistedBoundsCase | 949 // the non browser window. This differ from PersistedBoundsCase |
896 // in that this uses real ash shell implementations + StateProvider | 950 // in that this uses real ash shell implementations + StateProvider |
897 // TargetDisplayProvider, rather than mocks. | 951 // TargetDisplayProvider, rather than mocks. |
898 TEST_F(WindowSizerAshTest, DefaultBoundsInTargetDisplay) { | 952 TEST_F(WindowSizerAshTest, DefaultBoundsInTargetDisplay) { |
899 if (!SupportsMultipleDisplays() || !chrome::ShouldOpenAshOnStartup()) | 953 if (!SupportsMultipleDisplays() || !chrome::ShouldOpenAshOnStartup()) |
900 return; | 954 return; |
901 UpdateDisplay("500x500,600x600"); | 955 UpdateDisplay("500x500,600x600"); |
902 { | 956 { |
903 aura::Window* first_root = | 957 aura::Window* first_root = |
904 ash::Shell::GetAllRootWindows()[0]; | 958 ash::Shell::GetAllRootWindows()[0]; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 CreateTestWindowInShellWithId(1), | 993 CreateTestWindowInShellWithId(1), |
940 gfx::Rect(16, 32, 640, 320), | 994 gfx::Rect(16, 32, 640, 320), |
941 trusted_popup_create_params)); | 995 trusted_popup_create_params)); |
942 // Trusted popup windows should follow the saved show state and ignore the | 996 // Trusted popup windows should follow the saved show state and ignore the |
943 // last show state. | 997 // last show state. |
944 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, | 998 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
945 GetWindowShowState(ui::SHOW_STATE_DEFAULT, | 999 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
946 ui::SHOW_STATE_NORMAL, | 1000 ui::SHOW_STATE_NORMAL, |
947 BOTH, | 1001 BOTH, |
948 trusted_popup->browser(), | 1002 trusted_popup->browser(), |
| 1003 p1280x1024, |
| 1004 p1600x1200)); |
| 1005 // A popup that is sized to occupy the whole work area has default state. |
| 1006 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
| 1007 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
| 1008 ui::SHOW_STATE_NORMAL, |
| 1009 BOTH, |
| 1010 trusted_popup->browser(), |
| 1011 p1600x1200, |
949 p1600x1200)); | 1012 p1600x1200)); |
950 } | 1013 } |
OLD | NEW |