diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 18:39:30 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 18:39:30 +0000 |
commit | a764e16efd4e104e7e0d7a6f7827d0c5f73ec3ef (patch) | |
tree | 2c01abec174498ad8673edc3d4d9083010111ee3 /ash/wm/window_util_unittest.cc | |
parent | 37abba2c5dab032e73cf91e8792663e852434453 (diff) | |
download | chromium_src-a764e16efd4e104e7e0d7a6f7827d0c5f73ec3ef.zip chromium_src-a764e16efd4e104e7e0d7a6f7827d0c5f73ec3ef.tar.gz chromium_src-a764e16efd4e104e7e0d7a6f7827d0c5f73ec3ef.tar.bz2 |
Set screen bounds in wm::CenterWindow
BUG=229401
TEST=covered by test
Review URL: https://chromiumcodereview.appspot.com/14456007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/window_util_unittest.cc')
-rw-r--r-- | ash/wm/window_util_unittest.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ash/wm/window_util_unittest.cc b/ash/wm/window_util_unittest.cc new file mode 100644 index 0000000..930b658 --- /dev/null +++ b/ash/wm/window_util_unittest.cc @@ -0,0 +1,29 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/wm/window_util.h" + +#include "ash/screen_ash.h" +#include "ash/test/ash_test_base.h" +#include "ui/aura/window.h" + +namespace ash { + +typedef test::AshTestBase WindowUtilTest; + +TEST_F(WindowUtilTest, CenterWindow) { + UpdateDisplay("500x400, 600x400"); + scoped_ptr<aura::Window> window( + CreateTestWindowInShellWithBounds(gfx::Rect(12, 20, 100, 100))); + wm::CenterWindow(window.get()); + EXPECT_EQ("200,126 100x100", window->bounds().ToString()); + EXPECT_EQ("200,126 100x100", window->GetBoundsInScreen().ToString()); + window->SetBoundsInScreen(gfx::Rect(600, 0, 100, 100), + ScreenAsh::GetSecondaryDisplay()); + wm::CenterWindow(window.get()); + EXPECT_EQ("250,126 100x100", window->bounds().ToString()); + EXPECT_EQ("750,126 100x100", window->GetBoundsInScreen().ToString()); +} + +} // namespace ash |