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

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

Issue 190033005: [IME] Removes the duplicated IMEs in chrome://settings/languages, and support async component IMEs … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try to make test green. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/ime/component_extension_ime_manager.cc ('k') | ui/base/ime/chromeos/ime_bridge.cc » ('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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 mock_delegate_ = new MockComponentExtIMEManagerDelegate(); 116 mock_delegate_ = new MockComponentExtIMEManagerDelegate();
117 mock_delegate_->set_ime_list(ime_list_); 117 mock_delegate_->set_ime_list(ime_list_);
118 component_ext_mgr_.reset(new ComponentExtensionIMEManager()); 118 component_ext_mgr_.reset(new ComponentExtensionIMEManager());
119 component_ext_mgr_->AddObserver(this); 119 component_ext_mgr_->AddObserver(this);
120 EXPECT_FALSE(component_ext_mgr_->IsInitialized()); 120 EXPECT_FALSE(component_ext_mgr_->IsInitialized());
121 component_ext_mgr_->Initialize( 121 component_ext_mgr_->Initialize(
122 scoped_ptr<ComponentExtensionIMEManagerDelegate>( 122 scoped_ptr<ComponentExtensionIMEManagerDelegate>(
123 mock_delegate_).Pass()); 123 mock_delegate_).Pass());
124 EXPECT_TRUE(component_ext_mgr_->IsInitialized()); 124 EXPECT_TRUE(component_ext_mgr_->IsInitialized());
125 125 component_ext_mgr_->NotifyInitialized();
126 } 126 }
127 127
128 virtual void TearDown() { 128 virtual void TearDown() {
129 EXPECT_EQ(1, on_initialized_callcount_); 129 EXPECT_EQ(1, on_initialized_callcount_);
130 component_ext_mgr_->RemoveObserver(this); 130 component_ext_mgr_->RemoveObserver(this);
131 } 131 }
132 132
133 protected: 133 protected:
134 MockComponentExtIMEManagerDelegate* mock_delegate_; 134 MockComponentExtIMEManagerDelegate* mock_delegate_;
135 scoped_ptr<ComponentExtensionIMEManager> component_ext_mgr_; 135 scoped_ptr<ComponentExtensionIMEManager> component_ext_mgr_;
136 std::vector<ComponentExtensionIME> ime_list_; 136 std::vector<ComponentExtensionIME> ime_list_;
137 137
138 private: 138 private:
139 virtual void OnInitialized() OVERRIDE { 139 virtual void OnImeComponentExtensionInitialized() OVERRIDE {
140 ++on_initialized_callcount_; 140 ++on_initialized_callcount_;
141 } 141 }
142 142
143 int on_initialized_callcount_; 143 int on_initialized_callcount_;
144 144
145 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerTest); 145 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerTest);
146 }; 146 };
147 147
148 TEST_F(ComponentExtensionIMEManagerTest, LoadComponentExtensionIMETest) { 148 TEST_F(ComponentExtensionIMEManagerTest, LoadComponentExtensionIMETest) {
149 for (size_t i = 0; i < ime_list_.size(); ++i) { 149 for (size_t i = 0; i < ime_list_.size(); ++i) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 for (size_t i = 0; i < ime_list_.size(); ++i) { 246 for (size_t i = 0; i < ime_list_.size(); ++i) {
247 total_ime_size += ime_list_[i].engines.size(); 247 total_ime_size += ime_list_[i].engines.size();
248 } 248 }
249 EXPECT_EQ(total_ime_size, descriptors.size()); 249 EXPECT_EQ(total_ime_size, descriptors.size());
250 } 250 }
251 251
252 } // namespace 252 } // namespace
253 253
254 } // namespace input_method 254 } // namespace input_method
255 } // namespace chromeos 255 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/ime/component_extension_ime_manager.cc ('k') | ui/base/ime/chromeos/ime_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698