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

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

Issue 2686623003: Enable tests in TrayIMETest for MD (Closed)
Patch Set: nit Created 3 years, 10 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // Returns true if the background color of the tray is active. 46 // Returns true if the background color of the tray is active.
47 bool IsTrayBackgroundActive() { return GetTray()->is_active(); } 47 bool IsTrayBackgroundActive() { return GetTray()->is_active(); }
48 48
49 // Returns true if the IME menu bubble has been shown. 49 // Returns true if the IME menu bubble has been shown.
50 bool IsBubbleShown() { return GetTray()->IsImeMenuBubbleShown(); } 50 bool IsBubbleShown() { return GetTray()->IsImeMenuBubbleShown(); }
51 51
52 // Returns true if the IME menu list has been updated with the right IME list. 52 // Returns true if the IME menu list has been updated with the right IME list.
53 bool IsTrayImeListValid(const std::vector<IMEInfo>& expected_imes, 53 bool IsTrayImeListValid(const std::vector<IMEInfo>& expected_imes,
54 const IMEInfo& expected_current_ime) { 54 const IMEInfo& expected_current_ime) {
55 std::map<views::View*, std::string> ime_map = 55 const std::map<views::View*, std::string>& ime_map =
56 GetTray()->ime_list_view_->ime_map_; 56 ImeListViewTestApi(GetTray()->ime_list_view_).ime_map();
57 if (ime_map.size() != expected_imes.size()) 57 if (ime_map.size() != expected_imes.size())
58 return false; 58 return false;
59 59
60 std::vector<std::string> expected_ime_ids; 60 std::vector<std::string> expected_ime_ids;
61 for (const auto& ime : expected_imes) { 61 for (const auto& ime : expected_imes) {
62 expected_ime_ids.push_back(ime.id); 62 expected_ime_ids.push_back(ime.id);
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(),
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 input_method_manager = chromeos::input_method::InputMethodManager::Get(); 304 input_method_manager = chromeos::input_method::InputMethodManager::Get();
305 EXPECT_TRUE(input_method_manager && 305 EXPECT_TRUE(input_method_manager &&
306 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled()); 306 input_method_manager->IsEmojiHandwritingVoiceOnImeMenuEnabled());
307 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); 307 EXPECT_TRUE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
308 308
309 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD); 309 FocusInInputContext(ui::TEXT_INPUT_TYPE_PASSWORD);
310 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons()); 310 EXPECT_FALSE(GetTray()->ShouldShowEmojiHandwritingVoiceButtons());
311 } 311 }
312 312
313 } // namespace ash 313 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698