| OLD | NEW |
| 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/common/shelf/shelf_layout_manager.h" | 5 #include "ash/common/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/common/accelerators/accelerator_controller.h" | 7 #include "ash/common/accelerators/accelerator_controller.h" |
| 8 #include "ash/common/accelerators/accelerator_table.h" | 8 #include "ash/common/accelerators/accelerator_table.h" |
| 9 #include "ash/common/focus_cycler.h" | 9 #include "ash/common/focus_cycler.h" |
| 10 #include "ash/common/session/session_controller.h" | 10 #include "ash/common/session/session_controller.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 params.context = CurrentContext(); | 286 params.context = CurrentContext(); |
| 287 return CreateTestWidgetWithParams(params); | 287 return CreateTestWidgetWithParams(params); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void RunGestureDragTests(gfx::Vector2d); | 290 void RunGestureDragTests(gfx::Vector2d); |
| 291 | 291 |
| 292 // Turn on the lock screen. | 292 // Turn on the lock screen. |
| 293 void LockScreen() { | 293 void LockScreen() { |
| 294 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); | 294 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); |
| 295 info->state = session_manager::SessionState::LOCKED; | 295 info->state = session_manager::SessionState::LOCKED; |
| 296 ash::WmShell::Get()->session_controller()->SetSessionInfo(std::move(info)); | 296 ash::Shell::Get()->session_controller()->SetSessionInfo(std::move(info)); |
| 297 } | 297 } |
| 298 | 298 |
| 299 // Turn off the lock screen. | 299 // Turn off the lock screen. |
| 300 void UnlockScreen() { | 300 void UnlockScreen() { |
| 301 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); | 301 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); |
| 302 info->state = session_manager::SessionState::ACTIVE; | 302 info->state = session_manager::SessionState::ACTIVE; |
| 303 ash::WmShell::Get()->session_controller()->SetSessionInfo(std::move(info)); | 303 ash::Shell::Get()->session_controller()->SetSessionInfo(std::move(info)); |
| 304 } | 304 } |
| 305 | 305 |
| 306 int64_t GetPrimaryDisplayId() { | 306 int64_t GetPrimaryDisplayId() { |
| 307 return display::Screen::GetScreen()->GetPrimaryDisplay().id(); | 307 return display::Screen::GetScreen()->GetPrimaryDisplay().id(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 private: | 310 private: |
| 311 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManagerTest); | 311 DISALLOW_COPY_AND_ASSIGN(ShelfLayoutManagerTest); |
| 312 }; | 312 }; |
| 313 | 313 |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 UpdateAutoHideStateNow(); | 838 UpdateAutoHideStateNow(); |
| 839 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); | 839 EXPECT_EQ(SHELF_AUTO_HIDE_HIDDEN, shelf->GetAutoHideState()); |
| 840 } | 840 } |
| 841 | 841 |
| 842 // Assertions around the login screen. | 842 // Assertions around the login screen. |
| 843 TEST_F(ShelfLayoutManagerTest, VisibleWhenLoginScreenShowing) { | 843 TEST_F(ShelfLayoutManagerTest, VisibleWhenLoginScreenShowing) { |
| 844 WmShelf* shelf = GetPrimaryShelf(); | 844 WmShelf* shelf = GetPrimaryShelf(); |
| 845 | 845 |
| 846 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); | 846 mojom::SessionInfoPtr info = mojom::SessionInfo::New(); |
| 847 info->state = session_manager::SessionState::LOGIN_PRIMARY; | 847 info->state = session_manager::SessionState::LOGIN_PRIMARY; |
| 848 ash::WmShell::Get()->session_controller()->SetSessionInfo(std::move(info)); | 848 ash::Shell::Get()->session_controller()->SetSessionInfo(std::move(info)); |
| 849 | 849 |
| 850 EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); | 850 EXPECT_EQ(SHELF_VISIBLE, shelf->GetVisibilityState()); |
| 851 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); | 851 EXPECT_EQ(SHELF_BACKGROUND_OVERLAP, GetShelfWidget()->GetBackgroundType()); |
| 852 } | 852 } |
| 853 | 853 |
| 854 // Assertions around the lock screen showing. | 854 // Assertions around the lock screen showing. |
| 855 TEST_F(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) { | 855 TEST_F(ShelfLayoutManagerTest, VisibleWhenLockScreenShowing) { |
| 856 WmShelf* shelf = GetPrimaryShelf(); | 856 WmShelf* shelf = GetPrimaryShelf(); |
| 857 ShelfLayoutManager* layout_manager = GetShelfLayoutManager(); | 857 ShelfLayoutManager* layout_manager = GetShelfLayoutManager(); |
| 858 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 858 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 // Open keyboard in sticky mode. | 1805 // Open keyboard in sticky mode. |
| 1806 kb_controller->ShowKeyboard(true); | 1806 kb_controller->ShowKeyboard(true); |
| 1807 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); | 1807 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); |
| 1808 | 1808 |
| 1809 // Work area should be changed. | 1809 // Work area should be changed. |
| 1810 EXPECT_NE(orig_work_area, | 1810 EXPECT_NE(orig_work_area, |
| 1811 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); | 1811 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); |
| 1812 } | 1812 } |
| 1813 | 1813 |
| 1814 } // namespace ash | 1814 } // namespace ash |
| OLD | NEW |