| Index: ash/shelf/shelf_layout_manager_unittest.cc
|
| diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
|
| index 8dac93d1d2eab50088a05a1df743e4b2b11746fc..e3adc363f43f1c41b1ab08cb7a4d1226f679fb18 100644
|
| --- a/ash/shelf/shelf_layout_manager_unittest.cc
|
| +++ b/ash/shelf/shelf_layout_manager_unittest.cc
|
| @@ -9,10 +9,10 @@
|
| #include "ash/ash_switches.h"
|
| #include "ash/display/display_manager.h"
|
| #include "ash/focus_cycler.h"
|
| -#include "ash/launcher/launcher.h"
|
| #include "ash/root_window_controller.h"
|
| #include "ash/screen_ash.h"
|
| #include "ash/session_state_delegate.h"
|
| +#include "ash/shelf/shelf.h"
|
| #include "ash/shelf/shelf_layout_manager_observer.h"
|
| #include "ash/shelf/shelf_view.h"
|
| #include "ash/shelf/shelf_widget.h"
|
| @@ -22,7 +22,7 @@
|
| #include "ash/system/tray/system_tray.h"
|
| #include "ash/system/tray/system_tray_item.h"
|
| #include "ash/test/ash_test_base.h"
|
| -#include "ash/test/launcher_test_api.h"
|
| +#include "ash/test/shelf_test_api.h"
|
| #include "ash/wm/window_state.h"
|
| #include "ash/wm/window_util.h"
|
| #include "base/command_line.h"
|
| @@ -669,7 +669,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
|
|
|
| gfx::Rect status_bounds(
|
| shelf->status_area_widget()->GetWindowBoundsInScreen());
|
| - gfx::Rect launcher_bounds(
|
| + gfx::Rect shelf_bounds(
|
| shelf->GetWindowBoundsInScreen());
|
| int shelf_height = manager->GetIdealBounds().height();
|
| gfx::Screen* screen = Shell::GetScreen();
|
| @@ -707,9 +707,8 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetVisible) {
|
| EXPECT_EQ(shelf_height, display.GetWorkAreaInsets().bottom());
|
|
|
| // Make sure the bounds of the two widgets changed.
|
| - launcher_bounds = shelf->GetNativeView()->bounds();
|
| - EXPECT_LT(launcher_bounds.y(),
|
| - screen->GetPrimaryDisplay().bounds().bottom());
|
| + shelf_bounds = shelf->GetNativeView()->bounds();
|
| + EXPECT_LT(shelf_bounds.y(), screen->GetPrimaryDisplay().bounds().bottom());
|
| status_bounds = shelf->status_area_widget()->GetNativeView()->bounds();
|
| EXPECT_LT(status_bounds.y(),
|
| screen->GetPrimaryDisplay().bounds().bottom());
|
| @@ -775,17 +774,17 @@ TEST_F(ShelfLayoutManagerTest, SetStateWhileAnimating) {
|
| small_change);
|
| }
|
|
|
| -// Makes sure the launcher is sized when the status area changes size.
|
| -TEST_F(ShelfLayoutManagerTest, LauncherUpdatedWhenStatusAreaChangesSize) {
|
| - Launcher* launcher = Launcher::ForPrimaryDisplay();
|
| - ASSERT_TRUE(launcher);
|
| +// Makes sure the shelf is sized when the status area changes size.
|
| +TEST_F(ShelfLayoutManagerTest, ShelfUpdatedWhenStatusAreaChangesSize) {
|
| + Shelf* shelf = Shelf::ForPrimaryDisplay();
|
| + ASSERT_TRUE(shelf);
|
| ShelfWidget* shelf_widget = GetShelfWidget();
|
| ASSERT_TRUE(shelf_widget);
|
| ASSERT_TRUE(shelf_widget->status_area_widget());
|
| shelf_widget->status_area_widget()->SetBounds(
|
| gfx::Rect(0, 0, 200, 200));
|
| EXPECT_EQ(200, shelf_widget->GetContentsView()->width() -
|
| - test::LauncherTestAPI(launcher).shelf_view()->width());
|
| + test::ShelfTestAPI(shelf).shelf_view()->width());
|
| }
|
|
|
|
|
| @@ -816,7 +815,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_AutoHide) {
|
| EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
|
|
|
| // LayoutShelf() forces the animation to completion, at which point the
|
| - // launcher should go off the screen.
|
| + // shelf should go off the screen.
|
| shelf->LayoutShelf();
|
| EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize,
|
| GetShelfWidget()->GetWindowBoundsInScreen().y());
|
| @@ -977,7 +976,7 @@ TEST_F(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) {
|
|
|
| aura::Window* root = Shell::GetPrimaryRootWindow();
|
| // LayoutShelf() forces the animation to completion, at which point the
|
| - // launcher should go off the screen.
|
| + // shelf should go off the screen.
|
| shelf->LayoutShelf();
|
| EXPECT_EQ(root->bounds().bottom() - ShelfLayoutManager::kAutoHideSize,
|
| GetShelfWidget()->GetWindowBoundsInScreen().y());
|
| @@ -1197,8 +1196,8 @@ TEST_F(ShelfLayoutManagerTest, TestDimmingBehaviorWithMenus) {
|
| EXPECT_EQ(0, shelf->shelf_widget()->GetDimmingAlphaForTest());
|
| }
|
|
|
| -// Verifies the shelf is visible when status/launcher is focused.
|
| -TEST_F(ShelfLayoutManagerTest, VisibleWhenStatusOrLauncherFocused) {
|
| +// Verifies the shelf is visible when status/shelf is focused.
|
| +TEST_F(ShelfLayoutManagerTest, VisibleWhenStatusOrShelfFocused) {
|
| // Since ShelfLayoutManager queries for mouse location, move the mouse so
|
| // it isn't over the shelf.
|
| aura::test::EventGenerator generator(
|
| @@ -1217,7 +1216,7 @@ TEST_F(ShelfLayoutManagerTest, VisibleWhenStatusOrLauncherFocused) {
|
| EXPECT_EQ(SHELF_AUTO_HIDE, shelf->visibility_state());
|
| EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->auto_hide_state());
|
|
|
| - // Focus the launcher. Have to go through the focus cycler as normal focus
|
| + // Focus the shelf. Have to go through the focus cycler as normal focus
|
| // requests to it do nothing.
|
| GetShelfWidget()->GetFocusCycler()->RotateFocus(FocusCycler::FORWARD);
|
| EXPECT_EQ(SHELF_AUTO_HIDE_SHOWN, shelf->auto_hide_state());
|
| @@ -1404,7 +1403,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
|
| EXPECT_EQ(SHELF_VISIBLE, shelf->visibility_state());
|
|
|
| shelf->SetAlignment(SHELF_ALIGNMENT_LEFT);
|
| - gfx::Rect launcher_bounds(
|
| + gfx::Rect shelf_bounds(
|
| GetShelfWidget()->GetWindowBoundsInScreen());
|
| const gfx::Screen* screen = Shell::GetScreen();
|
| gfx::Display display =
|
| @@ -1413,7 +1412,7 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
|
| EXPECT_EQ(shelf->GetIdealBounds().width(),
|
| display.GetWorkAreaInsets().left());
|
| EXPECT_GE(
|
| - launcher_bounds.width(),
|
| + shelf_bounds.width(),
|
| GetShelfWidget()->GetContentsView()->GetPreferredSize().width());
|
| EXPECT_EQ(SHELF_ALIGNMENT_LEFT, GetSystemTray()->shelf_alignment());
|
| StatusAreaWidget* status_area_widget = GetShelfWidget()->status_area_widget();
|
| @@ -1425,9 +1424,9 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().top());
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().bottom());
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().right());
|
| - EXPECT_EQ(display.bounds().x(), launcher_bounds.x());
|
| - EXPECT_EQ(display.bounds().y(), launcher_bounds.y());
|
| - EXPECT_EQ(display.bounds().height(), launcher_bounds.height());
|
| + EXPECT_EQ(display.bounds().x(), shelf_bounds.x());
|
| + EXPECT_EQ(display.bounds().y(), shelf_bounds.y());
|
| + EXPECT_EQ(display.bounds().height(), shelf_bounds.height());
|
| shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
|
| display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
|
| EXPECT_EQ(ShelfLayoutManager::kAutoHideSize,
|
| @@ -1437,13 +1436,13 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
|
| shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
|
| shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT);
|
| display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
|
| - launcher_bounds = GetShelfWidget()->GetWindowBoundsInScreen();
|
| + shelf_bounds = GetShelfWidget()->GetWindowBoundsInScreen();
|
| display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
|
| ASSERT_NE(-1, display.id());
|
| EXPECT_EQ(shelf->GetIdealBounds().width(),
|
| display.GetWorkAreaInsets().right());
|
| - EXPECT_GE(launcher_bounds.width(),
|
| - GetShelfWidget()->GetContentsView()->GetPreferredSize().width());
|
| + EXPECT_GE(shelf_bounds.width(),
|
| + GetShelfWidget()->GetContentsView()->GetPreferredSize().width());
|
| EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, GetSystemTray()->shelf_alignment());
|
| status_bounds = gfx::Rect(status_area_widget->GetWindowBoundsInScreen());
|
| EXPECT_GE(status_bounds.width(),
|
| @@ -1453,9 +1452,9 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().top());
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().bottom());
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().left());
|
| - EXPECT_EQ(display.work_area().right(), launcher_bounds.x());
|
| - EXPECT_EQ(display.bounds().y(), launcher_bounds.y());
|
| - EXPECT_EQ(display.bounds().height(), launcher_bounds.height());
|
| + EXPECT_EQ(display.work_area().right(), shelf_bounds.x());
|
| + EXPECT_EQ(display.bounds().y(), shelf_bounds.y());
|
| + EXPECT_EQ(display.bounds().height(), shelf_bounds.height());
|
| shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
|
| display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
|
| EXPECT_EQ(ShelfLayoutManager::kAutoHideSize,
|
| @@ -1466,13 +1465,13 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
|
| shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER);
|
| shelf->SetAlignment(SHELF_ALIGNMENT_TOP);
|
| display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
|
| - launcher_bounds = GetShelfWidget()->GetWindowBoundsInScreen();
|
| + shelf_bounds = GetShelfWidget()->GetWindowBoundsInScreen();
|
| display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
|
| ASSERT_NE(-1, display.id());
|
| EXPECT_EQ(shelf->GetIdealBounds().height(),
|
| display.GetWorkAreaInsets().top());
|
| - EXPECT_GE(launcher_bounds.height(),
|
| - GetShelfWidget()->GetContentsView()->GetPreferredSize().height());
|
| + EXPECT_GE(shelf_bounds.height(),
|
| + GetShelfWidget()->GetContentsView()->GetPreferredSize().height());
|
| EXPECT_EQ(SHELF_ALIGNMENT_TOP, GetSystemTray()->shelf_alignment());
|
| status_bounds = gfx::Rect(status_area_widget->GetWindowBoundsInScreen());
|
| EXPECT_GE(status_bounds.height(),
|
| @@ -1482,9 +1481,9 @@ TEST_F(ShelfLayoutManagerTest, MAYBE_SetAlignment) {
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().right());
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().bottom());
|
| EXPECT_EQ(0, display.GetWorkAreaInsets().left());
|
| - EXPECT_EQ(display.work_area().y(), launcher_bounds.bottom());
|
| - EXPECT_EQ(display.bounds().x(), launcher_bounds.x());
|
| - EXPECT_EQ(display.bounds().width(), launcher_bounds.width());
|
| + EXPECT_EQ(display.work_area().y(), shelf_bounds.bottom());
|
| + EXPECT_EQ(display.bounds().x(), shelf_bounds.x());
|
| + EXPECT_EQ(display.bounds().width(), shelf_bounds.width());
|
| shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS);
|
| display = screen->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow());
|
| EXPECT_EQ(ShelfLayoutManager::kAutoHideSize,
|
|
|