summaryrefslogtreecommitdiffstats
path: root/ash/focus_cycler_unittest.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-29 20:30:12 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-29 20:30:12 +0000
commit8676f04721b1a08e3ac16b3d33737e7d8706b402 (patch)
treeda7af576aae72bb1ea3a662ba07544bbac1df5b4 /ash/focus_cycler_unittest.cc
parent72a22eb913ab85b47971038acc7ca7117a96d633 (diff)
downloadchromium_src-8676f04721b1a08e3ac16b3d33737e7d8706b402.zip
chromium_src-8676f04721b1a08e3ac16b3d33737e7d8706b402.tar.gz
chromium_src-8676f04721b1a08e3ac16b3d33737e7d8706b402.tar.bz2
Makes the shelf visible if the launcher/status has focus.
BUG=120706 TEST=see bug, also covered by unit tests R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/9890001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129679 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/focus_cycler_unittest.cc')
-rw-r--r--ash/focus_cycler_unittest.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/ash/focus_cycler_unittest.cc b/ash/focus_cycler_unittest.cc
index 9bc23b9..7a5bec9 100644
--- a/ash/focus_cycler_unittest.cc
+++ b/ash/focus_cycler_unittest.cc
@@ -23,6 +23,15 @@ using aura::test::CreateTestWindowWithId;
using aura::Window;
using internal::FocusCycler;
+namespace {
+
+internal::StatusAreaView* GetStatusAreaView(views::Widget* widget) {
+ return static_cast<internal::StatusAreaView*>(
+ widget->GetContentsView()->child_at(0));
+}
+
+} // namespace
+
typedef AshTestBase FocusCyclerTest;
TEST_F(FocusCyclerTest, CycleFocusBrowserOnly) {
@@ -48,8 +57,8 @@ TEST_F(FocusCyclerTest, CycleFocusForward) {
views::Widget* status_widget = internal::CreateStatusArea(NULL);
ASSERT_TRUE(status_widget);
focus_cycler->AddWidget(status_widget);
- static_cast<internal::StatusAreaView*>(status_widget->GetContentsView())->
- SetFocusCyclerForTesting(focus_cycler.get());
+ GetStatusAreaView(status_widget)->SetFocusCyclerForTesting(
+ focus_cycler.get());
// Add a mock button to the status area.
status_widget->GetContentsView()->AddChildView(
@@ -90,8 +99,8 @@ TEST_F(FocusCyclerTest, CycleFocusBackward) {
views::Widget* status_widget = internal::CreateStatusArea(NULL);
ASSERT_TRUE(status_widget);
focus_cycler->AddWidget(status_widget);
- static_cast<internal::StatusAreaView*>(status_widget->GetContentsView())->
- SetFocusCyclerForTesting(focus_cycler.get());
+ GetStatusAreaView(status_widget)->SetFocusCyclerForTesting(
+ focus_cycler.get());
// Add a mock button to the status area.
status_widget->GetContentsView()->AddChildView(
@@ -163,8 +172,8 @@ TEST_F(FocusCyclerLauncherTest, CycleFocusForwardInvisible) {
views::Widget* status_widget = internal::CreateStatusArea(NULL);
ASSERT_TRUE(status_widget);
focus_cycler->AddWidget(status_widget);
- static_cast<internal::StatusAreaView*>(status_widget->GetContentsView())->
- SetFocusCyclerForTesting(focus_cycler.get());
+ GetStatusAreaView(status_widget)->SetFocusCyclerForTesting(
+ focus_cycler.get());
// Add a mock button to the status area.
status_widget->GetContentsView()->AddChildView(
@@ -201,8 +210,8 @@ TEST_F(FocusCyclerLauncherTest, CycleFocusBackwardInvisible) {
views::Widget* status_widget = internal::CreateStatusArea(NULL);
ASSERT_TRUE(status_widget);
focus_cycler->AddWidget(status_widget);
- static_cast<internal::StatusAreaView*>(status_widget->GetContentsView())->
- SetFocusCyclerForTesting(focus_cycler.get());
+ GetStatusAreaView(status_widget)->SetFocusCyclerForTesting(
+ focus_cycler.get());
// Add a mock button to the status area.
status_widget->GetContentsView()->AddChildView(