| 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/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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 for (const auto& ime : ime_map) { | 64 for (const auto& ime : ime_map) { |
| 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; | |
| 74 ime.first->GetAccessibleNodeData(&node_data); | 73 ime.first->GetAccessibleNodeData(&node_data); |
| 75 const auto checked_state = static_cast<ui::AXCheckedState>( | 74 const auto checked_state = static_cast<ui::AXCheckedState>( |
| 76 node_data.GetIntAttribute(ui::AX_ATTR_CHECKED_STATE)); | 75 node_data.GetIntAttribute(ui::AX_ATTR_CHECKED_STATE)); |
| 77 if (checked_state == ui::AX_CHECKED_STATE_TRUE) { | 76 if (checked_state == ui::AX_CHECKED_STATE_TRUE) { |
| 78 if (ime.second != expected_current_ime.id) | 77 if (ime.second != expected_current_ime.id) |
| 79 return false; | 78 return false; |
| 80 } | 79 } |
| 81 } | 80 } |
| 82 return true; | 81 return true; |
| 83 } | 82 } |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 input_method_manager = chromeos::input_method::InputMethodManager::Get(); | 313 input_method_manager = chromeos::input_method::InputMethodManager::Get(); |
| 315 EXPECT_TRUE(input_method_manager && | 314 EXPECT_TRUE(input_method_manager && |
| 316 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled()); | 315 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled()); |
| 317 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); | 316 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); |
| 318 | 317 |
| 319 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD); | 318 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD); |
| 320 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); | 319 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); |
| 321 } | 320 } |
| 322 | 321 |
| 323 } // namespace ash | 322 } // namespace ash |
| OLD | NEW |