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/common/wm/window_cycle_controller.h" | 5 #include "ash/common/wm/window_cycle_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/aura/wm_window_aura.h" | 10 #include "ash/aura/wm_window_aura.h" |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 controller->HandleCycleWindow(WindowCycleController::FORWARD); | 479 controller->HandleCycleWindow(WindowCycleController::FORWARD); |
480 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); | 480 EXPECT_TRUE(wm::IsActiveWindow(window0.get())); |
481 } | 481 } |
482 | 482 |
483 // Tests that beginning window selection hides the app list. | 483 // Tests that beginning window selection hides the app list. |
484 TEST_F(WindowCycleControllerTest, SelectingHidesAppList) { | 484 TEST_F(WindowCycleControllerTest, SelectingHidesAppList) { |
485 WindowCycleController* controller = WmShell::Get()->window_cycle_controller(); | 485 WindowCycleController* controller = WmShell::Get()->window_cycle_controller(); |
486 | 486 |
487 std::unique_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0)); | 487 std::unique_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0)); |
488 std::unique_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1)); | 488 std::unique_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1)); |
489 Shell::GetInstance()->ShowAppList(NULL); | 489 WmShell::Get()->ShowAppList(); |
490 EXPECT_TRUE(Shell::GetInstance()->GetAppListTargetVisibility()); | 490 EXPECT_TRUE(WmShell::Get()->GetAppListTargetVisibility()); |
491 controller->HandleCycleWindow(WindowCycleController::FORWARD); | 491 controller->HandleCycleWindow(WindowCycleController::FORWARD); |
492 EXPECT_FALSE(Shell::GetInstance()->GetAppListTargetVisibility()); | 492 EXPECT_FALSE(WmShell::Get()->GetAppListTargetVisibility()); |
493 } | 493 } |
494 | 494 |
495 // Tests that cycling through windows shows and minimizes windows as they | 495 // Tests that cycling through windows shows and minimizes windows as they |
496 // are passed. | 496 // are passed. |
497 TEST_F(WindowCycleControllerTest, CyclePreservesMinimization) { | 497 TEST_F(WindowCycleControllerTest, CyclePreservesMinimization) { |
498 WindowCycleController* controller = WmShell::Get()->window_cycle_controller(); | 498 WindowCycleController* controller = WmShell::Get()->window_cycle_controller(); |
499 | 499 |
500 std::unique_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0)); | 500 std::unique_ptr<aura::Window> window0(CreateTestWindowInShellWithId(0)); |
501 std::unique_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1)); | 501 std::unique_ptr<aura::Window> window1(CreateTestWindowInShellWithId(1)); |
502 wm::ActivateWindow(window1.get()); | 502 wm::ActivateWindow(window1.get()); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 generator.PressKey(ui::VKEY_TAB, ui::EF_ALT_DOWN); | 612 generator.PressKey(ui::VKEY_TAB, ui::EF_ALT_DOWN); |
613 EXPECT_EQ(0u, key_count.GetCountAndReset()); | 613 EXPECT_EQ(0u, key_count.GetCountAndReset()); |
614 generator.ReleaseKey(ui::VKEY_TAB, ui::EF_ALT_DOWN); | 614 generator.ReleaseKey(ui::VKEY_TAB, ui::EF_ALT_DOWN); |
615 EXPECT_EQ(0u, key_count.GetCountAndReset()); | 615 EXPECT_EQ(0u, key_count.GetCountAndReset()); |
616 generator.ReleaseKey(ui::VKEY_MENU, ui::EF_NONE); | 616 generator.ReleaseKey(ui::VKEY_MENU, ui::EF_NONE); |
617 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsActive()); | 617 EXPECT_TRUE(wm::GetWindowState(w1.get())->IsActive()); |
618 EXPECT_EQ(0u, key_count.GetCountAndReset()); | 618 EXPECT_EQ(0u, key_count.GetCountAndReset()); |
619 } | 619 } |
620 | 620 |
621 } // namespace ash | 621 } // namespace ash |
OLD | NEW |