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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 93 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
94 #define MAYBE_DefaultSizeCase DISABLED_DefaultSizeCase | 94 #define MAYBE_DefaultSizeCase DISABLED_DefaultSizeCase |
95 #else | 95 #else |
96 #define MAYBE_DefaultSizeCase DefaultSizeCase | 96 #define MAYBE_DefaultSizeCase DefaultSizeCase |
97 #endif | 97 #endif |
98 | 98 |
99 // Test that the window is sized appropriately for the first run experience | 99 // Test that the window is sized appropriately for the first run experience |
100 // where the default window bounds calculation is invoked. | 100 // where the default window bounds calculation is invoked. |
101 TEST_F(WindowSizerAshTest, MAYBE_DefaultSizeCase) { | 101 TEST_F(WindowSizerAshTest, MAYBE_DefaultSizeCase) { |
102 #if defined(OS_WIN) | 102 #if defined(OS_WIN) |
103 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kOpenAsh); | 103 base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kOpenAsh); |
104 #endif | 104 #endif |
105 { // 4:3 monitor case, 1024x768, no taskbar | 105 { // 4:3 monitor case, 1024x768, no taskbar |
106 gfx::Rect window_bounds; | 106 gfx::Rect window_bounds; |
107 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(), | 107 GetWindowBounds(p1024x768, p1024x768, gfx::Rect(), gfx::Rect(), |
108 gfx::Rect(), DEFAULT, NULL, gfx::Rect(), &window_bounds); | 108 gfx::Rect(), DEFAULT, NULL, gfx::Rect(), &window_bounds); |
109 EXPECT_EQ(gfx::Rect(ash::WindowPositioner::kDesktopBorderSize, | 109 EXPECT_EQ(gfx::Rect(ash::WindowPositioner::kDesktopBorderSize, |
110 ash::WindowPositioner::kDesktopBorderSize, | 110 ash::WindowPositioner::kDesktopBorderSize, |
111 1024 - ash::WindowPositioner::kDesktopBorderSize * 2, | 111 1024 - ash::WindowPositioner::kDesktopBorderSize * 2, |
112 768 - ash::WindowPositioner::kDesktopBorderSize), | 112 768 - ash::WindowPositioner::kDesktopBorderSize), |
113 window_bounds); | 113 window_bounds); |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_MAXIMIZED); | 882 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_MAXIMIZED); |
883 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, | 883 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, |
884 ui::SHOW_STATE_NORMAL, | 884 ui::SHOW_STATE_NORMAL, |
885 BOTH, | 885 BOTH, |
886 browser_window->browser(), | 886 browser_window->browser(), |
887 p1600x1200, | 887 p1600x1200, |
888 p1600x1200), ui::SHOW_STATE_MAXIMIZED); | 888 p1600x1200), ui::SHOW_STATE_MAXIMIZED); |
889 | 889 |
890 // Check that setting the maximized command line option is forcing the | 890 // Check that setting the maximized command line option is forcing the |
891 // maximized state. | 891 // maximized state. |
892 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kStartMaximized); | 892 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 893 switches::kStartMaximized); |
893 | 894 |
894 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_NORMAL); | 895 browser_window->browser()->set_initial_show_state(ui::SHOW_STATE_NORMAL); |
895 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, | 896 EXPECT_EQ(GetWindowShowState(ui::SHOW_STATE_NORMAL, |
896 ui::SHOW_STATE_NORMAL, | 897 ui::SHOW_STATE_NORMAL, |
897 BOTH, | 898 BOTH, |
898 browser_window->browser(), | 899 browser_window->browser(), |
899 p1600x1200, | 900 p1600x1200, |
900 p1600x1200), ui::SHOW_STATE_MAXIMIZED); | 901 p1600x1200), ui::SHOW_STATE_MAXIMIZED); |
901 | 902 |
902 // The popup should favor the initial show state over the command line. | 903 // The popup should favor the initial show state over the command line. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 p1600x1200)); | 1001 p1600x1200)); |
1001 // A popup that is sized to occupy the whole work area has default state. | 1002 // A popup that is sized to occupy the whole work area has default state. |
1002 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, | 1003 EXPECT_EQ(ui::SHOW_STATE_DEFAULT, |
1003 GetWindowShowState(ui::SHOW_STATE_DEFAULT, | 1004 GetWindowShowState(ui::SHOW_STATE_DEFAULT, |
1004 ui::SHOW_STATE_NORMAL, | 1005 ui::SHOW_STATE_NORMAL, |
1005 BOTH, | 1006 BOTH, |
1006 trusted_popup->browser(), | 1007 trusted_popup->browser(), |
1007 p1600x1200, | 1008 p1600x1200, |
1008 p1600x1200)); | 1009 p1600x1200)); |
1009 } | 1010 } |
OLD | NEW |