| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/shelf/shelf_widget.h" | 5 #include "ash/shelf/shelf_widget.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_delegate.h" | 9 #include "ash/shelf/shelf_delegate.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return GetShelfWidget()->shelf_layout_manager(); | 35 return GetShelfWidget()->shelf_layout_manager(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 typedef test::AshTestBase ShelfWidgetTest; | 40 typedef test::AshTestBase ShelfWidgetTest; |
| 41 | 41 |
| 42 void TestLauncherAlignment(aura::Window* root, | 42 void TestLauncherAlignment(aura::Window* root, |
| 43 wm::ShelfAlignment alignment, | 43 wm::ShelfAlignment alignment, |
| 44 const std::string& expected) { | 44 const std::string& expected) { |
| 45 Shell::GetInstance()->SetShelfAlignment(alignment, root); | 45 Shelf::ForWindow(root)->SetAlignment(alignment); |
| 46 display::Screen* screen = display::Screen::GetScreen(); | 46 display::Screen* screen = display::Screen::GetScreen(); |
| 47 EXPECT_EQ(expected, | 47 EXPECT_EQ(expected, |
| 48 screen->GetDisplayNearestWindow(root).work_area().ToString()); | 48 screen->GetDisplayNearestWindow(root).work_area().ToString()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 #if defined(OS_WIN) && !defined(USE_ASH) | 51 #if defined(OS_WIN) && !defined(USE_ASH) |
| 52 // TODO(msw): Broken on Windows. http://crbug.com/584038 | 52 // TODO(msw): Broken on Windows. http://crbug.com/584038 |
| 53 #define MAYBE_TestAlignment DISABLED_TestAlignment | 53 #define MAYBE_TestAlignment DISABLED_TestAlignment |
| 54 #else | 54 #else |
| 55 #define MAYBE_TestAlignment TestAlignment | 55 #define MAYBE_TestAlignment TestAlignment |
| 56 #endif | 56 #endif |
| 57 TEST_F(ShelfWidgetTest, MAYBE_TestAlignment) { | 57 TEST_F(ShelfWidgetTest, MAYBE_TestAlignment) { |
| 58 Shelf* shelf = Shelf::ForPrimaryDisplay(); | |
| 59 UpdateDisplay("400x400"); | 58 UpdateDisplay("400x400"); |
| 60 ASSERT_TRUE(shelf); | |
| 61 { | 59 { |
| 62 SCOPED_TRACE("Single Bottom"); | 60 SCOPED_TRACE("Single Bottom"); |
| 63 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), | 61 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), |
| 64 wm::SHELF_ALIGNMENT_BOTTOM, "0,0 400x353"); | 62 wm::SHELF_ALIGNMENT_BOTTOM, "0,0 400x353"); |
| 65 } | 63 } |
| 66 { | 64 { |
| 67 SCOPED_TRACE("Single Locked"); | 65 SCOPED_TRACE("Single Locked"); |
| 68 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), | 66 TestLauncherAlignment(Shell::GetPrimaryRootWindow(), |
| 69 wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, "0,0 400x353"); | 67 wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, "0,0 400x353"); |
| 70 } | 68 } |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 454 } |
| 457 | 455 |
| 458 TEST_F(ShelfWidgetTestWithDelegate, CreateLockedShelf) { | 456 TEST_F(ShelfWidgetTestWithDelegate, CreateLockedShelf) { |
| 459 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. | 457 // The auto hide state 'HIDDEN' is returned for any non-auto-hide behavior. |
| 460 TestCreateShelfWithInitialValues(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, | 458 TestCreateShelfWithInitialValues(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, |
| 461 SHELF_AUTO_HIDE_BEHAVIOR_NEVER, | 459 SHELF_AUTO_HIDE_BEHAVIOR_NEVER, |
| 462 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); | 460 SHELF_VISIBLE, SHELF_AUTO_HIDE_HIDDEN); |
| 463 } | 461 } |
| 464 | 462 |
| 465 } // namespace ash | 463 } // namespace ash |
| OLD | NEW |