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

Unified Diff: ash/focus_cycler_unittest.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: formatting and moved a couple unit tests Created 7 years, 10 months 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
Index: ash/focus_cycler_unittest.cc
diff --git a/ash/focus_cycler_unittest.cc b/ash/focus_cycler_unittest.cc
index c4fd2d1986fb61f02bc2d63876e7200d40d923f6..2efaea8406c502bcb5d1a9ede2f80f41b92e5c18 100644
--- a/ash/focus_cycler_unittest.cc
+++ b/ash/focus_cycler_unittest.cc
@@ -6,6 +6,7 @@
#include "ash/launcher/launcher.h"
#include "ash/root_window_controller.h"
+#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/system/status_area_widget.h"
@@ -54,7 +55,7 @@ class FocusCyclerTest : public AshTestBase {
tray_.reset();
}
- Launcher::ForPrimaryDisplay()->SetFocusCycler(NULL);
+ Launcher::ForPrimaryDisplay()->shelf_widget()->SetFocusCycler(NULL);
Mr4D (OOO till 08-26) 2013/02/27 19:42:51 Couldn't you use here "shelf_widget()" (as defined
Harry McCleave 2013/03/01 04:31:19 Done.
focus_cycler_.reset();
@@ -85,14 +86,13 @@ class FocusCyclerTest : public AshTestBase {
SystemTray* tray() { return tray_.get(); }
- views::Widget* launcher_widget() {
- return Launcher::ForPrimaryDisplay()->widget();
+ ShelfWidget* shelf_widget() {
+ return Launcher::ForPrimaryDisplay()->shelf_widget();
}
- void InstallFocusCycleOnLauncher() {
- // Add the launcher
- Launcher* launcher = Launcher::ForPrimaryDisplay();
- launcher->SetFocusCycler(focus_cycler());
+ void InstallFocusCycleOnShelf() {
+ // Add the shelf.
+ shelf_widget()->SetFocusCycler(focus_cycler());
}
private:
@@ -116,7 +116,7 @@ TEST_F(FocusCyclerTest, CycleFocusBrowserOnly) {
TEST_F(FocusCyclerTest, CycleFocusForward) {
ASSERT_TRUE(CreateTray());
- InstallFocusCycleOnLauncher();
+ InstallFocusCycleOnShelf();
// Create a single test window.
scoped_ptr<Window> window0(CreateTestWindowInShellWithId(0));
@@ -127,9 +127,9 @@ TEST_F(FocusCyclerTest, CycleFocusForward) {
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
EXPECT_TRUE(tray()->GetWidget()->IsActive());
- // Cycle focus to the launcher
+ // Cycle focus to the shelf
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
- EXPECT_TRUE(launcher_widget()->IsActive());
+ EXPECT_TRUE(shelf_widget()->IsActive());
// Cycle focus to the browser
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
@@ -139,7 +139,7 @@ TEST_F(FocusCyclerTest, CycleFocusForward) {
TEST_F(FocusCyclerTest, CycleFocusBackward) {
ASSERT_TRUE(CreateTray());
- InstallFocusCycleOnLauncher();
+ InstallFocusCycleOnShelf();
// Create a single test window.
scoped_ptr<Window> window0(CreateTestWindowInShellWithId(0));
@@ -148,7 +148,7 @@ TEST_F(FocusCyclerTest, CycleFocusBackward) {
// Cycle focus to the launcher
focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
- EXPECT_TRUE(launcher_widget()->IsActive());
+ EXPECT_TRUE(shelf_widget()->IsActive());
// Cycle focus to the status area
focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
@@ -162,16 +162,16 @@ TEST_F(FocusCyclerTest, CycleFocusBackward) {
TEST_F(FocusCyclerTest, CycleFocusForwardBackward) {
ASSERT_TRUE(CreateTray());
- InstallFocusCycleOnLauncher();
+ InstallFocusCycleOnShelf();
// Create a single test window.
scoped_ptr<Window> window0(CreateTestWindowInShellWithId(0));
wm::ActivateWindow(window0.get());
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
- // Cycle focus to the launcher
+ // Cycle focus to the shelf
focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
- EXPECT_TRUE(launcher_widget()->IsActive());
+ EXPECT_TRUE(shelf_widget()->IsActive());
// Cycle focus to the status area
focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
@@ -187,7 +187,7 @@ TEST_F(FocusCyclerTest, CycleFocusForwardBackward) {
// Cycle focus to the launcher
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
- EXPECT_TRUE(launcher_widget()->IsActive());
+ EXPECT_TRUE(shelf_widget()->IsActive());
// Cycle focus to the browser
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
@@ -197,18 +197,18 @@ TEST_F(FocusCyclerTest, CycleFocusForwardBackward) {
TEST_F(FocusCyclerTest, CycleFocusNoBrowser) {
ASSERT_TRUE(CreateTray());
- InstallFocusCycleOnLauncher();
+ InstallFocusCycleOnShelf();
// Add the launcher and focus it
- focus_cycler()->FocusWidget(launcher_widget());
+ focus_cycler()->FocusWidget(shelf_widget());
// Cycle focus to the status area
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
EXPECT_TRUE(tray()->GetWidget()->IsActive());
- // Cycle focus to the launcher
+ // Cycle focus to the shelf
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
- EXPECT_TRUE(launcher_widget()->IsActive());
+ EXPECT_TRUE(shelf_widget()->IsActive());
// Cycle focus to the status area
focus_cycler()->RotateFocus(FocusCycler::FORWARD);
@@ -216,17 +216,17 @@ TEST_F(FocusCyclerTest, CycleFocusNoBrowser) {
// Cycle focus to the launcher
focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
- EXPECT_TRUE(launcher_widget()->IsActive());
+ EXPECT_TRUE(shelf_widget()->IsActive());
// Cycle focus to the status area
focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
EXPECT_TRUE(tray()->GetWidget()->IsActive());
}
-TEST_F(FocusCyclerTest, Launcher_CycleFocusForward) {
+TEST_F(FocusCyclerTest, Shelf_CycleFocusForward) {
ASSERT_TRUE(CreateTray());
- InstallFocusCycleOnLauncher();
- launcher_widget()->Hide();
+ InstallFocusCycleOnShelf();
+ shelf_widget()->Hide();
// Create a single test window.
scoped_ptr<Window> window0(CreateTestWindowInShellWithId(0));
@@ -242,10 +242,10 @@ TEST_F(FocusCyclerTest, Launcher_CycleFocusForward) {
EXPECT_TRUE(wm::IsActiveWindow(window0.get()));
}
-TEST_F(FocusCyclerTest, Launcher_CycleFocusBackwardInvisible) {
+TEST_F(FocusCyclerTest, Shelf_CycleFocusBackwardInvisible) {
ASSERT_TRUE(CreateTray());
- InstallFocusCycleOnLauncher();
- launcher_widget()->Hide();
+ InstallFocusCycleOnShelf();
+ shelf_widget()->Hide();
// Create a single test window.
scoped_ptr<Window> window0(CreateTestWindowInShellWithId(0));

Powered by Google App Engine
This is Rietveld 408576698