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

Side by Side Diff: chromeos/ime/component_extension_ime_manager_unittest.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test fixed. Re-sorted methods of StateImpl and IMM. Created 6 years, 4 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
« no previous file with comments | « chromeos/ime/component_extension_ime_manager.cc ('k') | chromeos/ime/input_method_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "chromeos/ime/component_extension_ime_manager.h" 6 #include "chromeos/ime/component_extension_ime_manager.h"
7 #include "chromeos/ime/extension_ime_util.h" 7 #include "chromeos/ime/extension_ime_util.h"
8 #include "chromeos/ime/mock_component_extension_ime_manager_delegate.h" 8 #include "chromeos/ime/mock_component_extension_ime_manager_delegate.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerTest); 129 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerTest);
130 }; 130 };
131 131
132 TEST_F(ComponentExtensionIMEManagerTest, LoadComponentExtensionIMETest) { 132 TEST_F(ComponentExtensionIMEManagerTest, LoadComponentExtensionIMETest) {
133 for (size_t i = 0; i < ime_list_.size(); ++i) { 133 for (size_t i = 0; i < ime_list_.size(); ++i) {
134 for (size_t j = 0; j < ime_list_[i].engines.size(); ++j) { 134 for (size_t j = 0; j < ime_list_[i].engines.size(); ++j) {
135 const std::string input_method_id = 135 const std::string input_method_id =
136 extension_ime_util::GetComponentInputMethodID( 136 extension_ime_util::GetComponentInputMethodID(
137 ime_list_[i].id, 137 ime_list_[i].id,
138 ime_list_[i].engines[j].engine_id); 138 ime_list_[i].engines[j].engine_id);
139 component_ext_mgr_->LoadComponentExtensionIME(input_method_id); 139 component_ext_mgr_->LoadComponentExtensionIME(NULL /* profile */,
140 input_method_id);
140 EXPECT_EQ(ime_list_[i].id, mock_delegate_->last_loaded_extension_id()); 141 EXPECT_EQ(ime_list_[i].id, mock_delegate_->last_loaded_extension_id());
141 } 142 }
142 } 143 }
143 EXPECT_EQ(9, mock_delegate_->load_call_count()); 144 EXPECT_EQ(9, mock_delegate_->load_call_count());
144 } 145 }
145 146
146 TEST_F(ComponentExtensionIMEManagerTest, UnloadComponentExtensionIMETest) { 147 TEST_F(ComponentExtensionIMEManagerTest, UnloadComponentExtensionIMETest) {
147 for (size_t i = 0; i < ime_list_.size(); ++i) { 148 for (size_t i = 0; i < ime_list_.size(); ++i) {
148 for (size_t j = 0; j < ime_list_[i].engines.size(); ++j) { 149 for (size_t j = 0; j < ime_list_[i].engines.size(); ++j) {
149 const std::string input_method_id = 150 const std::string input_method_id =
150 extension_ime_util::GetComponentInputMethodID( 151 extension_ime_util::GetComponentInputMethodID(
151 ime_list_[i].id, 152 ime_list_[i].id,
152 ime_list_[i].engines[j].engine_id); 153 ime_list_[i].engines[j].engine_id);
153 component_ext_mgr_->UnloadComponentExtensionIME(input_method_id); 154 component_ext_mgr_->UnloadComponentExtensionIME(NULL /* profile */,
155 input_method_id);
154 EXPECT_EQ(ime_list_[i].id, mock_delegate_->last_unloaded_extension_id()); 156 EXPECT_EQ(ime_list_[i].id, mock_delegate_->last_unloaded_extension_id());
155 } 157 }
156 } 158 }
157 EXPECT_EQ(9, mock_delegate_->unload_call_count()); 159 EXPECT_EQ(9, mock_delegate_->unload_call_count());
158 } 160 }
159 161
160 TEST_F(ComponentExtensionIMEManagerTest, IsWhitelistedTest) { 162 TEST_F(ComponentExtensionIMEManagerTest, IsWhitelistedTest) {
161 EXPECT_TRUE(component_ext_mgr_->IsWhitelisted( 163 EXPECT_TRUE(component_ext_mgr_->IsWhitelisted(
162 extension_ime_util::GetComponentInputMethodID( 164 extension_ime_util::GetComponentInputMethodID(
163 ime_list_[0].id, 165 ime_list_[0].id,
(...skipping 24 matching lines...) Expand all
188 for (size_t i = 0; i < ime_list_.size(); ++i) { 190 for (size_t i = 0; i < ime_list_.size(); ++i) {
189 total_ime_size += ime_list_[i].engines.size(); 191 total_ime_size += ime_list_[i].engines.size();
190 } 192 }
191 EXPECT_EQ(total_ime_size, descriptors.size()); 193 EXPECT_EQ(total_ime_size, descriptors.size());
192 } 194 }
193 195
194 } // namespace 196 } // namespace
195 197
196 } // namespace input_method 198 } // namespace input_method
197 } // namespace chromeos 199 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/ime/component_extension_ime_manager.cc ('k') | chromeos/ime/input_method_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698