| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ime/input_method_menu_item.h" | |
| 6 #include "ash/ime/input_method_menu_manager.h" | |
| 7 #include "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
| 8 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 11 #include "chromeos/ime/component_extension_ime_manager.h" | 9 #include "chromeos/ime/component_extension_ime_manager.h" |
| 12 #include "chromeos/ime/composition_text.h" | 10 #include "chromeos/ime/composition_text.h" |
| 13 #include "chromeos/ime/input_method_descriptor.h" | 11 #include "chromeos/ime/input_method_descriptor.h" |
| 14 #include "chromeos/ime/input_method_manager.h" | 12 #include "chromeos/ime/input_method_manager.h" |
| 15 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
| 16 #include "content/public/test/test_utils.h" | 14 #include "content/public/test/test_utils.h" |
| 17 #include "extensions/browser/process_manager.h" | 15 #include "extensions/browser/process_manager.h" |
| 18 #include "extensions/common/manifest_handlers/background_info.h" | 16 #include "extensions/common/manifest_handlers/background_info.h" |
| 19 #include "extensions/test/extension_test_message_listener.h" | 17 #include "extensions/test/extension_test_message_listener.h" |
| 20 #include "ui/base/ime/chromeos/ime_bridge.h" | 18 #include "ui/base/ime/chromeos/ime_bridge.h" |
| 21 #include "ui/base/ime/chromeos/mock_ime_candidate_window_handler.h" | 19 #include "ui/base/ime/chromeos/mock_ime_candidate_window_handler.h" |
| 22 #include "ui/base/ime/chromeos/mock_ime_input_context_handler.h" | 20 #include "ui/base/ime/chromeos/mock_ime_input_context_handler.h" |
| 23 #include "ui/base/ime/text_input_flags.h" | 21 #include "ui/base/ime/text_input_flags.h" |
| 22 #include "ui/chromeos/ime/input_method_menu_item.h" |
| 23 #include "ui/chromeos/ime/input_method_menu_manager.h" |
| 24 #include "ui/events/event.h" | 24 #include "ui/events/event.h" |
| 25 | 25 |
| 26 namespace chromeos { | 26 namespace chromeos { |
| 27 namespace input_method { | 27 namespace input_method { |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 const char kIdentityIMEID[] = | 30 const char kIdentityIMEID[] = |
| 31 "_ext_ime_iafoklpfplgfnoimmaejoeondnjnlcfpIdentityIME"; | 31 "_ext_ime_iafoklpfplgfnoimmaejoeondnjnlcfpIdentityIME"; |
| 32 const char kToUpperIMEID[] = | 32 const char kToUpperIMEID[] = |
| 33 "_ext_ime_iafoklpfplgfnoimmaejoeondnjnlcfpToUpperIME"; | 33 "_ext_ime_iafoklpfplgfnoimmaejoeondnjnlcfpToUpperIME"; |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 " id: 'ID4'," | 874 " id: 'ID4'," |
| 875 " label: 'LABEL4'," | 875 " label: 'LABEL4'," |
| 876 " style: 'separator'," | 876 " style: 'separator'," |
| 877 " visible: true," | 877 " visible: true," |
| 878 " checked: true" | 878 " checked: true" |
| 879 " }]" | 879 " }]" |
| 880 "});"; | 880 "});"; |
| 881 ASSERT_TRUE(content::ExecuteScript( | 881 ASSERT_TRUE(content::ExecuteScript( |
| 882 host->host_contents(), set_menu_item_test_script)); | 882 host->host_contents(), set_menu_item_test_script)); |
| 883 | 883 |
| 884 const ash::ime::InputMethodMenuItemList& props = | 884 const ui::ime::InputMethodMenuItemList& props = |
| 885 ash::ime::InputMethodMenuManager::GetInstance()-> | 885 ui::ime::InputMethodMenuManager::GetInstance()-> |
| 886 GetCurrentInputMethodMenuItemList(); | 886 GetCurrentInputMethodMenuItemList(); |
| 887 ASSERT_EQ(5U, props.size()); | 887 ASSERT_EQ(5U, props.size()); |
| 888 | 888 |
| 889 EXPECT_EQ("ID0", props[0].key); | 889 EXPECT_EQ("ID0", props[0].key); |
| 890 EXPECT_EQ("ID1", props[1].key); | 890 EXPECT_EQ("ID1", props[1].key); |
| 891 EXPECT_EQ("ID2", props[2].key); | 891 EXPECT_EQ("ID2", props[2].key); |
| 892 EXPECT_EQ("ID3", props[3].key); | 892 EXPECT_EQ("ID3", props[3].key); |
| 893 EXPECT_EQ("ID4", props[4].key); | 893 EXPECT_EQ("ID4", props[4].key); |
| 894 | 894 |
| 895 EXPECT_EQ("LABEL1", props[1].label); | 895 EXPECT_EQ("LABEL1", props[1].label); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 } | 984 } |
| 985 } | 985 } |
| 986 | 986 |
| 987 IMEBridge::Get()->SetInputContextHandler(NULL); | 987 IMEBridge::Get()->SetInputContextHandler(NULL); |
| 988 IMEBridge::Get()->SetCandidateWindowHandler(NULL); | 988 IMEBridge::Get()->SetCandidateWindowHandler(NULL); |
| 989 } | 989 } |
| 990 | 990 |
| 991 } // namespace | 991 } // namespace |
| 992 } // namespace input_method | 992 } // namespace input_method |
| 993 } // namespace chromeos | 993 } // namespace chromeos |
| OLD | NEW |