| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/wm/window_cycle_controller.h" | 5 #include "ash/wm/window_cycle_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
| 10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); | 462 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); |
| 463 } | 463 } |
| 464 | 464 |
| 465 // Tests that beginning window selection hides the app list. | 465 // Tests that beginning window selection hides the app list. |
| 466 TEST_F(WindowCycleControllerTest, SelectingHidesAppList) { | 466 TEST_F(WindowCycleControllerTest, SelectingHidesAppList) { |
| 467 WindowCycleController* controller = | 467 WindowCycleController* controller = |
| 468 Shell::GetInstance()->window_cycle_controller(); | 468 Shell::GetInstance()->window_cycle_controller(); |
| 469 | 469 |
| 470 scoped_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0)); | 470 scoped_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0)); |
| 471 scoped_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1)); | 471 scoped_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1)); |
| 472 Shell::GetInstance()->ToggleAppList(NULL); | 472 Shell::GetInstance()->ShowAppList(NULL); |
| 473 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); | 473 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); |
| 474 controller->HandleCycleWindow(WindowCycleController::FORWARD); | 474 controller->HandleCycleWindow(WindowCycleController::FORWARD); |
| 475 EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); | 475 EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); |
| 476 } | 476 } |
| 477 | 477 |
| 478 // Tests that cycling through windows shows and minimizes windows as they | 478 // Tests that cycling through windows shows and minimizes windows as they |
| 479 // are passed. | 479 // are passed. |
| 480 TEST_F(WindowCycleControllerTest, CyclePreservesMinimization) { | 480 TEST_F(WindowCycleControllerTest, CyclePreservesMinimization) { |
| 481 WindowCycleController* controller = | 481 WindowCycleController* controller = |
| 482 Shell::GetInstance()->window_cycle_controller(); | 482 Shell::GetInstance()->window_cycle_controller(); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 // Panel 1 is the next item as the MRU panel, removing it should make panel 2 | 579 // Panel 1 is the next item as the MRU panel, removing it should make panel 2 |
| 580 // the next window to be selected. | 580 // the next window to be selected. |
| 581 panel0.reset(); | 581 panel0.reset(); |
| 582 // Cycling again should now select panel1. | 582 // Cycling again should now select panel1. |
| 583 controller->HandleCycleWindow(WindowCycleController::FORWARD); | 583 controller->HandleCycleWindow(WindowCycleController::FORWARD); |
| 584 controller->StopCycling(); | 584 controller->StopCycling(); |
| 585 EXPECT_TRUE(wm::IsActiveWindow(panel1.get())); | 585 EXPECT_TRUE(wm::IsActiveWindow(panel1.get())); |
| 586 } | 586 } |
| 587 | 587 |
| 588 } // namespace ash | 588 } // namespace ash |
| OLD | NEW |