OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/aura_shell/launcher/launcher.h" |
| 6 |
| 7 #include "ui/aura_shell/shell.h" |
| 8 #include "ui/aura_shell/test/aura_shell_test_base.h" |
| 9 #include "ui/views/view.h" |
| 10 #include "ui/views/widget/widget.h" |
| 11 |
| 12 typedef aura_shell::test::AuraShellTestBase LauncherTest; |
| 13 |
| 14 namespace aura_shell { |
| 15 |
| 16 // Makes sure invoking SetStatusWidth on the launcher changes the size of the |
| 17 // LauncherView. |
| 18 TEST_F(LauncherTest, SetStatusWidth) { |
| 19 Launcher* launcher = Shell::GetInstance()->launcher(); |
| 20 ASSERT_TRUE(launcher); |
| 21 views::View* launcher_view = launcher->widget()->GetContentsView(); |
| 22 ASSERT_EQ(1, launcher_view->child_count()); |
| 23 launcher_view = launcher_view->child_at(0); |
| 24 |
| 25 int total_width = launcher->widget()->GetWindowScreenBounds().width(); |
| 26 ASSERT_GT(total_width, 0); |
| 27 launcher->SetStatusWidth(total_width / 2); |
| 28 EXPECT_EQ(total_width - total_width / 2, launcher_view->width()); |
| 29 } |
| 30 |
| 31 } // namespace aura_shell |
OLD | NEW |