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

Side by Side Diff: ash/launcher/launcher_unittest.cc

Issue 11451002: Focus launcher if spoken feedback is enabled and no other windows visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added end to end tests. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/launcher/launcher.h" 5 #include "ash/launcher/launcher.h"
6 #include "ash/launcher/launcher_button.h" 6 #include "ash/launcher/launcher_button.h"
7 #include "ash/launcher/launcher_model.h" 7 #include "ash/launcher/launcher_model.h"
8 #include "ash/launcher/launcher_view.h" 8 #include "ash/launcher/launcher_view.h"
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/test/ash_test_base.h" 11 #include "ash/test/ash_test_base.h"
12 #include "ash/test/launcher_view_test_api.h" 12 #include "ash/test/launcher_view_test_api.h"
13 #include "ash/wm/window_util.h"
13 #include "ui/views/view.h" 14 #include "ui/views/view.h"
14 #include "ui/views/widget/widget.h" 15 #include "ui/views/widget/widget.h"
15 16
16 typedef ash::test::AshTestBase LauncherTest; 17 typedef ash::test::AshTestBase LauncherTest;
17 using ash::internal::LauncherView; 18 using ash::internal::LauncherView;
18 using ash::internal::LauncherButton; 19 using ash::internal::LauncherButton;
19 20
20 namespace ash { 21 namespace ash {
21 22
22 // Makes sure invoking SetStatusSize on the launcher changes the size of the 23 // Makes sure invoking SetStatusSize on the launcher changes the size of the
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 int index = model->Add(item); 71 int index = model->Add(item);
71 ASSERT_EQ(++button_count, test.GetButtonCount()); 72 ASSERT_EQ(++button_count, test.GetButtonCount());
72 LauncherButton* button = test.GetButton(index); 73 LauncherButton* button = test.GetButton(index);
73 EXPECT_EQ(LauncherButton::STATE_RUNNING, button->state()); 74 EXPECT_EQ(LauncherButton::STATE_RUNNING, button->state());
74 75
75 // Remove it. 76 // Remove it.
76 model->RemoveItemAt(index); 77 model->RemoveItemAt(index);
77 ASSERT_EQ(--button_count, test.GetButtonCount()); 78 ASSERT_EQ(--button_count, test.GetButtonCount());
78 } 79 }
79 80
81 // Launcher can't be activated on mouse click, but it is activable from
82 // the focus cycler or as fallback.
83 TEST_F(LauncherTest, ActivateAsFallback) {
84 Launcher* launcher = Launcher::ForPrimaryDisplay();
85 views::Widget* launcher_widget = launcher->widget();
86 EXPECT_FALSE(launcher_widget->CanActivate());
87
88 launcher->WillActivateAsFallback();
89 EXPECT_TRUE(launcher_widget->CanActivate());
90
91 wm::ActivateWindow(launcher_widget->GetNativeWindow());
92 EXPECT_FALSE(launcher_widget->CanActivate());
93 }
94
80 } // namespace ash 95 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698