summaryrefslogtreecommitdiffstats
path: root/ash/shell_unittest.cc
diff options
context:
space:
mode:
authorjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 23:34:57 +0000
committerjamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 23:34:57 +0000
commit49451d98d5b289315043525960547915a548a6a5 (patch)
tree4b0ff1b146394ecea3482269cc3c0b0d4788a3b2 /ash/shell_unittest.cc
parentb4c49b366987e26e7bfc33c71a8ccc736a49210d (diff)
downloadchromium_src-49451d98d5b289315043525960547915a548a6a5.zip
chromium_src-49451d98d5b289315043525960547915a548a6a5.tar.gz
chromium_src-49451d98d5b289315043525960547915a548a6a5.tar.bz2
Aura: Rationalize window mode initialization
A. Unit tests run in 800x600 (so width != height) with a special static bool set to force overlapping window mode. B1. Developers with no switches set start with a 1280x1024 window in overlapping mode. B2. The screen resolution heuristic will choose overlapping mode if the screen is > 800 pixels tall, which makes B1 easy. C. Developer host window reshapes are interpreted as resolution changes, so if the developer makes the window big the mode switches to overlapping. D. Passing --aura-window-mode=<foo> sets the window mode for the entire session. This is *not* passed by session manager. If a device starts up with a low-resolution external monitor, it gets compact mode. BUG=113299 TEST=aura_shell_unittests ShellTest.*, manually running linux_chromeos with --aura-window-mode=compact / overlapping, manual test on device Review URL: http://codereview.chromium.org/9369050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_unittest.cc')
-rw-r--r--ash/shell_unittest.cc22
1 files changed, 4 insertions, 18 deletions
diff --git a/ash/shell_unittest.cc b/ash/shell_unittest.cc
index 9961491..a852188 100644
--- a/ash/shell_unittest.cc
+++ b/ash/shell_unittest.cc
@@ -106,20 +106,6 @@ class ModalWindow : public views::WidgetDelegateView {
DISALLOW_COPY_AND_ASSIGN(ModalWindow);
};
-// After base::AutoReset<> but via setter and getter.
-class AutoResetUseFullscreenHostWindow {
- public:
- AutoResetUseFullscreenHostWindow(bool new_value) {
- old_value_ = aura::RootWindow::use_fullscreen_host_window();
- aura::RootWindow::set_use_fullscreen_host_window(new_value);
- }
- ~AutoResetUseFullscreenHostWindow() {
- aura::RootWindow::set_use_fullscreen_host_window(old_value_);
- }
- private:
- bool old_value_;
-};
-
} // namespace
class ShellTest : public test::AuraShellTestBase {
@@ -298,8 +284,8 @@ TEST_F(ShellTest, IsScreenLocked) {
}
TEST_F(ShellTest, ComputeWindowMode) {
- // We only change default window mode with full-screen host windows.
- AutoResetUseFullscreenHostWindow use_fullscreen_host_window(true);
+ // Since we're testing window mode computations, don't force overlapping.
+ ash::Shell::set_window_mode_overlapping_for_test(false);
// Wide screens use normal window mode.
Shell* shell = Shell::GetInstance();
@@ -409,8 +395,8 @@ TEST_F(ShellTest, MAYBE_ChangeWindowMode) {
// only relevant on Chrome OS devices.
#if defined(OS_CHROMEOS)
TEST_F(ShellTest, ResizeRootWindow) {
- // We dynamically change window mode only with full-screen host windows.
- AutoResetUseFullscreenHostWindow use_fullscreen_host_window(true);
+ // Since we're testing window mode computations, don't force overlapping.
+ ash::Shell::set_window_mode_overlapping_for_test(false);
// Switching to a small screen enables compact window mode.
RootWindow::GetInstance()->SetHostSize(gfx::Size(1024, 768));