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

Unified Diff: ui/aura_shell/launcher/launcher_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/launcher/launcher.cc ('k') | ui/aura_shell/launcher/launcher_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/launcher/launcher_unittest.cc
diff --git a/ui/aura_shell/launcher/launcher_unittest.cc b/ui/aura_shell/launcher/launcher_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eccef4d727ec6cfd3a3c068a2403ea92da07bfe8
--- /dev/null
+++ b/ui/aura_shell/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 "ui/aura_shell/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
« no previous file with comments | « ui/aura_shell/launcher/launcher.cc ('k') | ui/aura_shell/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698