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" | 5 #include "ash/ime/input_method_menu_item.h" |
6 #include "ash/ime/input_method_menu_manager.h" | 6 #include "ash/ime/input_method_menu_manager.h" |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
10 #include "chrome/browser/extensions/extension_test_message_listener.h" | 10 #include "chrome/browser/extensions/extension_test_message_listener.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 protected: | 59 protected: |
60 void LoadTestInputMethod() { | 60 void LoadTestInputMethod() { |
61 // This will load "chrome/test/data/extensions/input_ime" | 61 // This will load "chrome/test/data/extensions/input_ime" |
62 ExtensionTestMessageListener ime_ready_listener("ReadyToUseImeEvent", | 62 ExtensionTestMessageListener ime_ready_listener("ReadyToUseImeEvent", |
63 false); | 63 false); |
64 extension_ = LoadExtensionWithType("input_ime", GetParam()); | 64 extension_ = LoadExtensionWithType("input_ime", GetParam()); |
65 ASSERT_TRUE(extension_); | 65 ASSERT_TRUE(extension_); |
66 ASSERT_TRUE(ime_ready_listener.WaitUntilSatisfied()); | 66 ASSERT_TRUE(ime_ready_listener.WaitUntilSatisfied()); |
67 | 67 |
68 // Make sure ComponentExtensionIMEManager is initialized. | |
69 // ComponentExtensionIMEManagerImpl::InitializeAsync posts | |
70 // ReadComponentExtensionsInfo to the FILE thread for the | |
71 // initialization. If it is never initialized for some reasons, | |
72 // the test is timed out and failed. | |
73 ComponentExtensionIMEManager* ceimm = | |
74 InputMethodManager::Get()->GetComponentExtensionIMEManager(); | |
75 while (!ceimm->IsInitialized()) { | |
76 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | |
77 } | |
78 | |
79 // Extension IMEs are not enabled by default. | 68 // Extension IMEs are not enabled by default. |
80 std::vector<std::string> extension_ime_ids; | 69 std::vector<std::string> extension_ime_ids; |
81 extension_ime_ids.push_back(kIdentityIMEID); | 70 extension_ime_ids.push_back(kIdentityIMEID); |
82 extension_ime_ids.push_back(kToUpperIMEID); | 71 extension_ime_ids.push_back(kToUpperIMEID); |
83 extension_ime_ids.push_back(kAPIArgumentIMEID); | 72 extension_ime_ids.push_back(kAPIArgumentIMEID); |
84 InputMethodManager::Get()->SetEnabledExtensionImes(&extension_ime_ids); | 73 InputMethodManager::Get()->SetEnabledExtensionImes(&extension_ime_ids); |
85 | 74 |
86 InputMethodDescriptors extension_imes; | 75 InputMethodDescriptors extension_imes; |
87 InputMethodManager::Get()->GetInputMethodExtensions(&extension_imes); | 76 InputMethodManager::Get()->GetInputMethodExtensions(&extension_imes); |
88 | 77 |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 } | 928 } |
940 } | 929 } |
941 | 930 |
942 IMEBridge::Get()->SetInputContextHandler(NULL); | 931 IMEBridge::Get()->SetInputContextHandler(NULL); |
943 IMEBridge::Get()->SetCandidateWindowHandler(NULL); | 932 IMEBridge::Get()->SetCandidateWindowHandler(NULL); |
944 } | 933 } |
945 | 934 |
946 } // namespace | 935 } // namespace |
947 } // namespace input_method | 936 } // namespace input_method |
948 } // namespace chromeos | 937 } // namespace chromeos |
OLD | NEW |