summaryrefslogtreecommitdiffstats
path: root/ui
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 /ui
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 'ui')
-rw-r--r--ui/aura/test/aura_test_base.cc3
-rw-r--r--ui/aura/window_unittest.cc4
2 files changed, 4 insertions, 3 deletions
diff --git a/ui/aura/test/aura_test_base.cc b/ui/aura/test/aura_test_base.cc
index 20061dd..da126e8 100644
--- a/ui/aura/test/aura_test_base.cc
+++ b/ui/aura/test/aura_test_base.cc
@@ -23,7 +23,8 @@ AuraTestBase::AuraTestBase()
#endif
RootWindow::GetInstance()->Show();
- RootWindow::GetInstance()->SetHostSize(gfx::Size(600, 600));
+ // Ensure width != height so tests won't confuse them.
+ RootWindow::GetInstance()->SetHostSize(gfx::Size(800, 600));
// Disable animations during tests.
ui::LayerAnimator::set_disable_animations_for_test(true);
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 564414b..8fadcad 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -821,7 +821,7 @@ TEST_F(WindowTest, Transform) {
// Rotate it clock-wise 90 degrees.
ui::Transform transform;
transform.SetRotate(90.0f);
- transform.ConcatTranslate(size.width(), 0);
+ transform.ConcatTranslate(size.height(), 0);
root_window->SetTransform(transform);
// The size should be the transformed size.
@@ -852,7 +852,7 @@ TEST_F(WindowTest, MAYBE_TransformGesture) {
// Rotate the root-window clock-wise 90 degrees.
ui::Transform transform;
transform.SetRotate(90.0f);
- transform.ConcatTranslate(size.width(), 0);
+ transform.ConcatTranslate(size.height(), 0);
root_window->SetTransform(transform);
TouchEvent press(ui::ET_TOUCH_PRESSED,