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

Side by Side Diff: ash/system/ime_menu/ime_menu_tray_unittest.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: git cl try Created 3 years, 8 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 | « ash/system/ime_menu/ime_list_view.cc ('k') | ash/system/tray/hover_highlight_view.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/system/ime_menu/ime_menu_tray.h" 5 #include "ash/system/ime_menu/ime_menu_tray.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/ime_menu/ime_list_view.h" 10 #include "ash/system/ime_menu/ime_list_view.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // Tests that all the IMEs on the view is in the list of selected IMEs. 65 // Tests that all the IMEs on the view is in the list of selected IMEs.
66 if (std::find(expected_ime_ids.begin(), expected_ime_ids.end(), 66 if (std::find(expected_ime_ids.begin(), expected_ime_ids.end(),
67 ime.second) == expected_ime_ids.end()) { 67 ime.second) == expected_ime_ids.end()) {
68 return false; 68 return false;
69 } 69 }
70 70
71 // Tests that the checked IME is the current IME. 71 // Tests that the checked IME is the current IME.
72 ui::AXNodeData node_data; 72 ui::AXNodeData node_data;
73 node_data.state = 0; 73 node_data.state = 0;
74 ime.first->GetAccessibleNodeData(&node_data); 74 ime.first->GetAccessibleNodeData(&node_data);
75 if (node_data.HasStateFlag(ui::AX_STATE_CHECKED)) { 75 const auto checked_state = static_cast<ui::AXCheckedState>(
76 node_data.GetIntAttribute(ui::AX_ATTR_CHECKED_STATE));
77 if (checked_state == ui::AX_CHECKED_STATE_TRUE) {
76 if (ime.second != expected_current_ime.id) 78 if (ime.second != expected_current_ime.id)
77 return false; 79 return false;
78 } 80 }
79 } 81 }
80 return true; 82 return true;
81 } 83 }
82 84
83 // Focuses in the given type of input context. 85 // Focuses in the given type of input context.
84 void FocusInInputContext(ui::TextInputType input_type) { 86 void FocusInInputContext(ui::TextInputType input_type) {
85 ui::IMEEngineHandlerInterface::InputContext input_context( 87 ui::IMEEngineHandlerInterface::InputContext input_context(
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 input_method_manager = chromeos::input_method::InputMethodManager::Get(); 306 input_method_manager = chromeos::input_method::InputMethodManager::Get();
305 EXPECT_TRUE(input_method_manager && 307 EXPECT_TRUE(input_method_manager &&
306 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled()); 308 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled());
307 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); 309 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
308 310
309 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD); 311 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD);
310 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); 312 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
311 } 313 }
312 314
313 } // namespace ash 315 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/ime_menu/ime_list_view.cc ('k') | ash/system/tray/hover_highlight_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698