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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc

Issue 49773003: ChromeOS: Remove MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 7 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/input_method/input_method_manager_impl.h" 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 void InitComponentExtension() { 144 void InitComponentExtension() {
145 mock_delegate_ = new MockComponentExtIMEManagerDelegate(); 145 mock_delegate_ = new MockComponentExtIMEManagerDelegate();
146 mock_delegate_->set_ime_list(ime_list_); 146 mock_delegate_->set_ime_list(ime_list_);
147 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate(mock_delegate_); 147 scoped_ptr<ComponentExtensionIMEManagerDelegate> delegate(mock_delegate_);
148 manager_->InitializeComponentExtensionForTesting(delegate.Pass()); 148 manager_->InitializeComponentExtensionForTesting(delegate.Pass());
149 } 149 }
150 150
151 // Helper function to initialize IBus bus connection for testing. Do not use 151 // Helper function to initialize IBus bus connection for testing. Do not use
152 // ibus related mocks before calling this function. 152 // ibus related mocks before calling this function.
153 void InitIBusBus() { 153 void InitIBusBus() {
154 fake_dbus_thread_manager_->InitIBusBus("dummy address", 154 mock_ibus_client_ = new MockIBusClient;
155 base::Bind(&base::DoNothing)); 155 fake_dbus_thread_manager_->SetIBusClient(
156 mock_ibus_client_ = fake_dbus_thread_manager_->mock_ibus_client(); 156 scoped_ptr<IBusClient>(mock_ibus_client_));
157 mock_ibus_daemon_controller_->EmulateConnect(); 157 mock_ibus_daemon_controller_->EmulateConnect();
158 } 158 }
159 159
160 scoped_ptr<InputMethodManagerImpl> manager_; 160 scoped_ptr<InputMethodManagerImpl> manager_;
161 FakeInputMethodDelegate* delegate_; 161 FakeInputMethodDelegate* delegate_;
162 MockIBusController* controller_; 162 MockIBusController* controller_;
163 MockCandidateWindowController* candidate_window_controller_; 163 MockCandidateWindowController* candidate_window_controller_;
164 MockIBusDaemonController* mock_ibus_daemon_controller_; 164 MockIBusDaemonController* mock_ibus_daemon_controller_;
165 scoped_ptr<MockIMEEngineHandler> mock_engine_handler_; 165 scoped_ptr<MockIMEEngineHandler> mock_engine_handler_;
166 MockIBusClient* mock_ibus_client_; 166 MockIBusClient* mock_ibus_client_;
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id()); 1293 EXPECT_EQ(fallback_id, manager_->GetCurrentInputMethod().id());
1294 1294
1295 // After component extension IME is initialized, previous specified input 1295 // After component extension IME is initialized, previous specified input
1296 // method should be automatically enabled. 1296 // method should be automatically enabled.
1297 InitComponentExtension(); 1297 InitComponentExtension();
1298 EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id()); 1298 EXPECT_EQ(xkb_id, manager_->GetCurrentInputMethod().id());
1299 } 1299 }
1300 1300
1301 } // namespace input_method 1301 } // namespace input_method
1302 } // namespace chromeos 1302 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698