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

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

Issue 2694903010: AX checked state changes (Closed)
Patch Set: Fix compiler error 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
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/common/system/chromeos/ime_menu/ime_menu_tray.h" 5 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
6 6
7 #include "ash/common/accelerators/accelerator_controller.h" 7 #include "ash/common/accelerators/accelerator_controller.h"
8 #include "ash/common/accessibility_delegate.h" 8 #include "ash/common/accessibility_delegate.h"
9 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h" 9 #include "ash/common/system/chromeos/ime_menu/ime_list_view.h"
10 #include "ash/common/system/status_area_widget.h" 10 #include "ash/common/system/status_area_widget.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 int checkedState =
dmazzoni 2017/02/28 00:10:50 checked_state (variable naming in C++ code)
76 node_data.GetIntAttribute(ui::AX_ATTR_CHECKED_STATE);
77 if (checkedState == ui::AX_CHECKED_STATE_TRUE ||
78 checkedState == ui::AX_CHECKED_STATE_MIXED) {
dmazzoni 2017/02/28 00:10:50 I'd skip MIXED here unless there's any reason to b
76 if (ime.second != expected_current_ime.id) 79 if (ime.second != expected_current_ime.id)
77 return false; 80 return false;
78 } 81 }
79 } 82 }
80 return true; 83 return true;
81 } 84 }
82 85
83 // Focuses in the given type of input context. 86 // Focuses in the given type of input context.
84 void FocusInInputContext(ui::TextInputType input_type) { 87 void FocusInInputContext(ui::TextInputType input_type) {
85 ui::IMEEngineHandlerInterface::InputContext input_context( 88 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(); 307 input_method_manager = chromeos::input_method::InputMethodManager::Get();
305 EXPECT_TRUE(input_method_manager && 308 EXPECT_TRUE(input_method_manager &&
306 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled()); 309 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled());
307 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); 310 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
308 311
309 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD); 312 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD);
310 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); 313 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
311 } 314 }
312 315
313 } // namespace ash 316 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698