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

Side by Side Diff: ash/accelerators/accelerator_controller_unittest.cc

Issue 2750483005: Moves app_list() and related functions from Shell to WmShell (Closed)
Patch Set: dont explicitly delete Created 3 years, 9 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
« no previous file with comments | « no previous file | ash/accelerators/accelerator_filter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/accelerators/accelerator_controller.h" 5 #include "ash/common/accelerators/accelerator_controller.h"
6 6
7 #include "ash/common/accelerators/accelerator_table.h" 7 #include "ash/common/accelerators/accelerator_table.h"
8 #include "ash/common/accessibility_delegate.h" 8 #include "ash/common/accessibility_delegate.h"
9 #include "ash/common/accessibility_types.h" 9 #include "ash/common/accessibility_types.h"
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 // Lock screen 1013 // Lock screen
1014 // NOTE: Accelerators that do not work on the lock screen need to be 1014 // NOTE: Accelerators that do not work on the lock screen need to be
1015 // tested before the sequence below is invoked because it causes a side 1015 // tested before the sequence below is invoked because it causes a side
1016 // effect of locking the screen. 1016 // effect of locking the screen.
1017 EXPECT_TRUE( 1017 EXPECT_TRUE(
1018 ProcessInController(ui::Accelerator(ui::VKEY_L, ui::EF_COMMAND_DOWN))); 1018 ProcessInController(ui::Accelerator(ui::VKEY_L, ui::EF_COMMAND_DOWN)));
1019 } 1019 }
1020 1020
1021 TEST_F(AcceleratorControllerTest, GlobalAcceleratorsToggleAppList) { 1021 TEST_F(AcceleratorControllerTest, GlobalAcceleratorsToggleAppList) {
1022 app_list::test::TestAppListPresenter test_app_list_presenter; 1022 app_list::test::TestAppListPresenter test_app_list_presenter;
1023 WmShell::Get()->app_list()->SetAppListPresenter( 1023 Shell::Get()->app_list()->SetAppListPresenter(
1024 test_app_list_presenter.CreateInterfacePtrAndBind()); 1024 test_app_list_presenter.CreateInterfacePtrAndBind());
1025 AccessibilityDelegate* delegate = 1025 AccessibilityDelegate* delegate =
1026 Shell::GetInstance()->accessibility_delegate(); 1026 Shell::GetInstance()->accessibility_delegate();
1027 1027
1028 // The press event should not toggle the AppList, the release should instead. 1028 // The press event should not toggle the AppList, the release should instead.
1029 EXPECT_FALSE( 1029 EXPECT_FALSE(
1030 ProcessInController(ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE))); 1030 ProcessInController(ui::Accelerator(ui::VKEY_LWIN, ui::EF_NONE)));
1031 RunAllPendingInMessageLoop(); 1031 RunAllPendingInMessageLoop();
1032 EXPECT_EQ(ui::VKEY_LWIN, GetCurrentAccelerator().key_code()); 1032 EXPECT_EQ(ui::VKEY_LWIN, GetCurrentAccelerator().key_code());
1033 EXPECT_EQ(0u, test_app_list_presenter.toggle_count()); 1033 EXPECT_EQ(0u, test_app_list_presenter.toggle_count());
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 // Expect no notifications from the new accelerators. 1568 // Expect no notifications from the new accelerators.
1569 EXPECT_TRUE(IsMessageCenterEmpty()); 1569 EXPECT_TRUE(IsMessageCenterEmpty());
1570 1570
1571 // If the action is LOCK_SCREEN, we must reset the state by unlocking the 1571 // If the action is LOCK_SCREEN, we must reset the state by unlocking the
1572 // screen before we proceed testing the rest of accelerators. 1572 // screen before we proceed testing the rest of accelerators.
1573 ResetStateIfNeeded(); 1573 ResetStateIfNeeded();
1574 } 1574 }
1575 } 1575 }
1576 1576
1577 } // namespace ash 1577 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698