diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-23 21:35:52 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-23 21:35:52 +0000 |
commit | 7634f96b932b670de6e34552a9e0923147da3486 (patch) | |
tree | 2d755027fd1a3038335e3a3c38680274b448cdbe /ash/launcher/launcher_unittest.cc | |
parent | 7edb817aa768be2278f9b5bc34fda9d95cc4bdde (diff) | |
download | chromium_src-7634f96b932b670de6e34552a9e0923147da3486.zip chromium_src-7634f96b932b670de6e34552a9e0923147da3486.tar.gz chromium_src-7634f96b932b670de6e34552a9e0923147da3486.tar.bz2 |
Move more stuff down into ash.
http://crbug.com/108457
TEST=none
TBR=sky
Review URL: http://codereview.chromium.org/9030007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115739 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher/launcher_unittest.cc')
-rw-r--r-- | ash/launcher/launcher_unittest.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/ash/launcher/launcher_unittest.cc b/ash/launcher/launcher_unittest.cc new file mode 100644 index 0000000..de65658 --- /dev/null +++ b/ash/launcher/launcher_unittest.cc @@ -0,0 +1,31 @@ +// Copyright (c) 2011 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/launcher/launcher.h" + +#include "ui/aura_shell/shell.h" +#include "ui/aura_shell/test/aura_shell_test_base.h" +#include "ui/views/view.h" +#include "ui/views/widget/widget.h" + +typedef aura_shell::test::AuraShellTestBase LauncherTest; + +namespace aura_shell { + +// Makes sure invoking SetStatusWidth on the launcher changes the size of the +// LauncherView. +TEST_F(LauncherTest, SetStatusWidth) { + Launcher* launcher = Shell::GetInstance()->launcher(); + ASSERT_TRUE(launcher); + views::View* launcher_view = launcher->widget()->GetContentsView(); + ASSERT_EQ(1, launcher_view->child_count()); + launcher_view = launcher_view->child_at(0); + + int total_width = launcher->widget()->GetWindowScreenBounds().width(); + ASSERT_GT(total_width, 0); + launcher->SetStatusWidth(total_width / 2); + EXPECT_EQ(total_width - total_width / 2, launcher_view->width()); +} + +} // namespace aura_shell |