Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: ui/aura_shell/shelf_layout_manager_unittest.cc

Issue 8953004: Now that the launcher is sized to the width of the root window we need (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura_shell/shelf_layout_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/aura_shell/shelf_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698