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

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

Issue 784823002: Pass through the CONVERT/NONCONVERT/HANKAKU_ZENKAKU keys. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update unit tests to meets latest expectation. Created 6 years 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 | « ash/accelerators/accelerator_controller.cc ('k') | no next file » | 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/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/display/display_manager.h" 10 #include "ash/display/display_manager.h"
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 EXPECT_FALSE(ProcessInController(hangul)); 1047 EXPECT_FALSE(ProcessInController(hangul));
1048 DummyImeControlDelegate* delegate = new DummyImeControlDelegate; 1048 DummyImeControlDelegate* delegate = new DummyImeControlDelegate;
1049 GetController()->SetImeControlDelegate( 1049 GetController()->SetImeControlDelegate(
1050 scoped_ptr<ImeControlDelegate>(delegate).Pass()); 1050 scoped_ptr<ImeControlDelegate>(delegate).Pass());
1051 EXPECT_EQ(0, delegate->handle_previous_ime_count()); 1051 EXPECT_EQ(0, delegate->handle_previous_ime_count());
1052 EXPECT_TRUE(ProcessInController(control_space_down)); 1052 EXPECT_TRUE(ProcessInController(control_space_down));
1053 EXPECT_EQ(1, delegate->handle_previous_ime_count()); 1053 EXPECT_EQ(1, delegate->handle_previous_ime_count());
1054 EXPECT_TRUE(ProcessInController(control_space_up)); 1054 EXPECT_TRUE(ProcessInController(control_space_up));
1055 EXPECT_EQ(1, delegate->handle_previous_ime_count()); 1055 EXPECT_EQ(1, delegate->handle_previous_ime_count());
1056 EXPECT_EQ(0, delegate->handle_switch_ime_count()); 1056 EXPECT_EQ(0, delegate->handle_switch_ime_count());
1057 EXPECT_TRUE(ProcessInController(convert)); 1057 EXPECT_FALSE(ProcessInController(convert));
1058 EXPECT_EQ(1, delegate->handle_switch_ime_count()); 1058 EXPECT_EQ(1, delegate->handle_switch_ime_count());
1059 EXPECT_TRUE(ProcessInController(non_convert)); 1059 EXPECT_FALSE(ProcessInController(non_convert));
1060 EXPECT_EQ(2, delegate->handle_switch_ime_count()); 1060 EXPECT_EQ(2, delegate->handle_switch_ime_count());
1061 EXPECT_TRUE(ProcessInController(wide_half_1)); 1061 EXPECT_FALSE(ProcessInController(wide_half_1));
1062 EXPECT_EQ(3, delegate->handle_switch_ime_count()); 1062 EXPECT_EQ(3, delegate->handle_switch_ime_count());
1063 EXPECT_TRUE(ProcessInController(wide_half_2)); 1063 EXPECT_FALSE(ProcessInController(wide_half_2));
1064 EXPECT_EQ(4, delegate->handle_switch_ime_count()); 1064 EXPECT_EQ(4, delegate->handle_switch_ime_count());
1065 EXPECT_TRUE(ProcessInController(hangul)); 1065 EXPECT_FALSE(ProcessInController(hangul));
1066 EXPECT_EQ(5, delegate->handle_switch_ime_count()); 1066 EXPECT_EQ(5, delegate->handle_switch_ime_count());
1067 } 1067 }
1068 1068
1069 // Test IME shortcuts that are triggered on key release. 1069 // Test IME shortcuts that are triggered on key release.
1070 { 1070 {
1071 const ui::Accelerator shift_alt_press(ui::VKEY_MENU, 1071 const ui::Accelerator shift_alt_press(ui::VKEY_MENU,
1072 ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN); 1072 ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN);
1073 const ReleaseAccelerator shift_alt(ui::VKEY_MENU, ui::EF_SHIFT_DOWN); 1073 const ReleaseAccelerator shift_alt(ui::VKEY_MENU, ui::EF_SHIFT_DOWN);
1074 const ui::Accelerator alt_shift_press(ui::VKEY_SHIFT, 1074 const ui::Accelerator alt_shift_press(ui::VKEY_SHIFT,
1075 ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN); 1075 ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN);
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 wm::ActivateWindow(window.get()); 1407 wm::ActivateWindow(window.get());
1408 GetController()->PerformActionIfEnabled(WINDOW_MINIMIZE); 1408 GetController()->PerformActionIfEnabled(WINDOW_MINIMIZE);
1409 delegate->TriggerAccessibilityAlert(ui::A11Y_ALERT_NONE); 1409 delegate->TriggerAccessibilityAlert(ui::A11Y_ALERT_NONE);
1410 GetController()->PerformActionIfEnabled(kActionsNeedingWindow[i]); 1410 GetController()->PerformActionIfEnabled(kActionsNeedingWindow[i]);
1411 EXPECT_NE(delegate->GetLastAccessibilityAlert(), 1411 EXPECT_NE(delegate->GetLastAccessibilityAlert(),
1412 ui::A11Y_ALERT_WINDOW_NEEDED); 1412 ui::A11Y_ALERT_WINDOW_NEEDED);
1413 } 1413 }
1414 } 1414 }
1415 1415
1416 } // namespace ash 1416 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698