From 52a49920649f6a29d17dc91b7101ff82b9a2ba96 Mon Sep 17 00:00:00 2001 From: "oshima@chromium.org" Date: Sat, 1 Dec 2012 01:48:45 +0000 Subject: Use WS_POPUP for ash_unittests - Layout test windows starting from (1,1) and move mouse to (0,0) so that they don't overlap unless test moves the cursor. - Enabled disabled tests. - RootWindowHostWin::SetBounds should move the window and call OnHostResized when the scale factor has changed. This also seems to fix the desktop size limitation issue (148691) probably because a popup window can be larger than the desktop size. BUG=150986,157817,141577,148691 TEST=none Review URL: https://chromiumcodereview.appspot.com/11428066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170621 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/test/ash_test_base.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'ash/test/ash_test_base.cc') diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 479bc40..e8d3514 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc @@ -26,6 +26,10 @@ #include "ui/gfx/display.h" #include "ui/gfx/screen.h" +#if defined(OS_WIN) +#include "ui/aura/root_window_host_win.h" +#endif + namespace ash { namespace test { @@ -43,8 +47,13 @@ AshTestBase::~AshTestBase() { } void AshTestBase::SetUp() { + // Use the origin (1,1) so that it doesn't over + // lap with the native mouse cursor. CommandLine::ForCurrentProcess()->AppendSwitchASCII( - switches::kAuraHostWindowSize, "0+0-800x600"); + switches::kAuraHostWindowSize, "1+1-800x600"); +#if defined(OS_WIN) + aura::test::SetUsePopupAsRootWindowForTest(true); +#endif // Disable animations during tests. ui::LayerAnimator::set_disable_animations_for_test(true); ui::TextInputTestSupport::Initialize(); @@ -53,9 +62,9 @@ void AshTestBase::SetUp() { ash::Shell::CreateInstance(test_shell_delegate_); Shell::GetPrimaryRootWindow()->Show(); Shell::GetPrimaryRootWindow()->ShowRootWindow(); - // Move the mouse cursor to far away so that native events doesn't + // Move the mouse cursor to (0,0) so that native events doesn't // interfere test expectations. - Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); + Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(0, 0)); Shell::GetInstance()->cursor_manager()->ShowCursor(true); } @@ -67,6 +76,9 @@ void AshTestBase::TearDown() { Shell::DeleteInstance(); aura::Env::DeleteInstance(); ui::TextInputTestSupport::Shutdown(); +#if defined(OS_WIN) + aura::test::SetUsePopupAsRootWindowForTest(false); +#endif } void AshTestBase::ChangeDisplayConfig(float scale, -- cgit v1.1