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

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

Issue 2971773003: Change Toggle High Contrast accelerator (Closed)
Patch Set: Rebase + Change commit message Created 3 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
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.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/accelerators/accelerator_controller.h" 5 #include "ash/accelerators/accelerator_controller.h"
6 6
7 #include "ash/accelerators/accelerator_table.h" 7 #include "ash/accelerators/accelerator_table.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/accessibility_types.h" 9 #include "ash/accessibility_types.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 } 1295 }
1296 1296
1297 TEST_F(DeprecatedAcceleratorTester, TestNewAccelerators) { 1297 TEST_F(DeprecatedAcceleratorTester, TestNewAccelerators) {
1298 // Add below the new accelerators that replaced the deprecated ones (if any). 1298 // Add below the new accelerators that replaced the deprecated ones (if any).
1299 const AcceleratorData kNewAccelerators[] = { 1299 const AcceleratorData kNewAccelerators[] = {
1300 {true, ui::VKEY_L, ui::EF_COMMAND_DOWN, LOCK_SCREEN}, 1300 {true, ui::VKEY_L, ui::EF_COMMAND_DOWN, LOCK_SCREEN},
1301 {true, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, NEXT_IME}, 1301 {true, ui::VKEY_SPACE, ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN, NEXT_IME},
1302 {true, ui::VKEY_ESCAPE, ui::EF_COMMAND_DOWN, SHOW_TASK_MANAGER}, 1302 {true, ui::VKEY_ESCAPE, ui::EF_COMMAND_DOWN, SHOW_TASK_MANAGER},
1303 {true, ui::VKEY_K, ui::EF_SHIFT_DOWN | ui::EF_COMMAND_DOWN, 1303 {true, ui::VKEY_K, ui::EF_SHIFT_DOWN | ui::EF_COMMAND_DOWN,
1304 SHOW_IME_MENU_BUBBLE}, 1304 SHOW_IME_MENU_BUBBLE},
1305 {true, ui::VKEY_H, ui::EF_COMMAND_DOWN | ui::EF_CONTROL_DOWN,
1306 TOGGLE_HIGH_CONTRAST},
1305 }; 1307 };
1306 1308
1307 // The NEXT_IME accelerator requires multiple IMEs to be available. 1309 // The NEXT_IME accelerator requires multiple IMEs to be available.
1308 AddTestImes(); 1310 AddTestImes();
1309 1311
1310 EXPECT_TRUE(IsMessageCenterEmpty()); 1312 EXPECT_TRUE(IsMessageCenterEmpty());
1311 1313
1312 for (auto data : kNewAccelerators) { 1314 for (auto data : kNewAccelerators) {
1313 EXPECT_TRUE(ProcessInController(CreateAccelerator(data))); 1315 EXPECT_TRUE(ProcessInController(CreateAccelerator(data)));
1314 1316
1315 // Expect no notifications from the new accelerators. 1317 // Expect no notifications from the new accelerators.
1316 EXPECT_TRUE(IsMessageCenterEmpty()); 1318 if (data.action != TOGGLE_HIGH_CONTRAST) {
1319 // The toggle high contrast accelerator displays a notification specific
1320 // to the high contrast mode.
1321 EXPECT_TRUE(IsMessageCenterEmpty());
1322 }
1317 1323
1318 // If the action is LOCK_SCREEN, we must reset the state by unlocking the 1324 // If the action is LOCK_SCREEN, we must reset the state by unlocking the
1319 // screen before we proceed testing the rest of accelerators. 1325 // screen before we proceed testing the rest of accelerators.
1320 ResetStateIfNeeded(); 1326 ResetStateIfNeeded();
1321 } 1327 }
1322 } 1328 }
1323 1329
1324 } // namespace ash 1330 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698