| OLD | NEW |
| 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 Loading... |
| 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 checked_state = |
| 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 Loading... |
| 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 |
| OLD | NEW |