Index: ui/aura_shell/shelf_layout_manager_unittest.cc |
diff --git a/ui/aura_shell/shelf_layout_manager_unittest.cc b/ui/aura_shell/shelf_layout_manager_unittest.cc |
index 4596b1ede8850fe87291082b1b53fbdd853f3511..920660d111f2c0d1ade8d0fc08ee707561beb47c 100644 |
--- a/ui/aura_shell/shelf_layout_manager_unittest.cc |
+++ b/ui/aura_shell/shelf_layout_manager_unittest.cc |
@@ -7,6 +7,7 @@ |
#include "ui/aura/root_window.h" |
#include "ui/aura/screen_aura.h" |
#include "ui/aura/window.h" |
+#include "ui/aura_shell/launcher/launcher.h" |
#include "ui/aura_shell/shell.h" |
#include "ui/aura_shell/shell_window_ids.h" |
#include "ui/aura_shell/test/aura_shell_test_base.h" |
@@ -104,5 +105,30 @@ TEST_F(ShelfLayoutManagerTest, LayoutShelfWhileAnimating) { |
gfx::Screen::GetPrimaryMonitorBounds().bottom()); |
} |
+// Makes sure the launcher is initially sized correctly. |
+TEST_F(ShelfLayoutManagerTest, LauncherInitiallySized) { |
+ Launcher* launcher = Shell::GetInstance()->launcher(); |
+ ASSERT_TRUE(launcher); |
+ ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); |
+ ASSERT_TRUE(shelf_layout_manager); |
+ ASSERT_TRUE(shelf_layout_manager->status()); |
+ int status_width = |
+ shelf_layout_manager->status()->GetWindowScreenBounds().width(); |
+ // Test only makes sense if the status is > 0, which is better be. |
+ EXPECT_GT(status_width, 0); |
+ EXPECT_EQ(status_width, launcher->GetStatusWidth()); |
+} |
+ |
+// Makes sure the launcher is sized when the status area changes size. |
+TEST_F(ShelfLayoutManagerTest, LauncherUpdatedWhenStatusAreaChangesSize) { |
+ Launcher* launcher = Shell::GetInstance()->launcher(); |
+ ASSERT_TRUE(launcher); |
+ ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager(); |
+ ASSERT_TRUE(shelf_layout_manager); |
+ ASSERT_TRUE(shelf_layout_manager->status()); |
+ shelf_layout_manager->status()->SetBounds(gfx::Rect(0, 0, 200, 200)); |
+ EXPECT_EQ(200, launcher->GetStatusWidth()); |
+} |
+ |
} // namespace internal |
} // namespace aura_shell |