Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(975)

Side by Side Diff: ash/wm/window_cycle_controller_unittest.cc

Issue 2169533002: mash: Migrate shelf app list button to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/wm/overview/window_selector_unittest.cc ('k') | chrome/browser/chromeos/accessibility/sticky_keys_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698