OLD | NEW |
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 "chromeos/dbus/ibus/ibus_panel_service.h" | 5 #include "chromeos/dbus/ibus/ibus_panel_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 scoped_ptr<MockIBusPanelCandidateWindowHandler> candidate_window_handler_; | 318 scoped_ptr<MockIBusPanelCandidateWindowHandler> candidate_window_handler_; |
319 // The mock property handler. Do not free, this is owned by IBusPanelService. | 319 // The mock property handler. Do not free, this is owned by IBusPanelService. |
320 scoped_ptr<MockIBusPanelPropertyHandler> property_handler_; | 320 scoped_ptr<MockIBusPanelPropertyHandler> property_handler_; |
321 // The stub input context client. | 321 // The stub input context client. |
322 scoped_ptr<IBusInputContextClient> stub_input_context_client_; | 322 scoped_ptr<IBusInputContextClient> stub_input_context_client_; |
323 // The mock bus. | 323 // The mock bus. |
324 scoped_refptr<dbus::MockBus> mock_bus_; | 324 scoped_refptr<dbus::MockBus> mock_bus_; |
325 // The mock exported object. | 325 // The mock exported object. |
326 scoped_refptr<dbus::MockExportedObject> mock_exported_object_; | 326 scoped_refptr<dbus::MockExportedObject> mock_exported_object_; |
327 // A message loop to emulate asynchronous behavior. | 327 // A message loop to emulate asynchronous behavior. |
328 MessageLoop message_loop_; | 328 base::MessageLoop message_loop_; |
329 // The map from method call to method call handler. | 329 // The map from method call to method call handler. |
330 std::map<std::string, dbus::ExportedObject::MethodCallCallback> | 330 std::map<std::string, dbus::ExportedObject::MethodCallCallback> |
331 method_callback_map_; | 331 method_callback_map_; |
332 | 332 |
333 private: | 333 private: |
334 // Used to implement the mock method call. | 334 // Used to implement the mock method call. |
335 void OnMethodExported( | 335 void OnMethodExported( |
336 const std::string& interface_name, | 336 const std::string& interface_name, |
337 const std::string& method_name, | 337 const std::string& method_name, |
338 const dbus::ExportedObject::MethodCallCallback& method_callback, | 338 const dbus::ExportedObject::MethodCallCallback& method_callback, |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 // Call exported function. | 616 // Call exported function. |
617 EXPECT_NE(method_callback_map_.find(ibus::panel::kUpdatePropertyMethod), | 617 EXPECT_NE(method_callback_map_.find(ibus::panel::kUpdatePropertyMethod), |
618 method_callback_map_.end()); | 618 method_callback_map_.end()); |
619 method_callback_map_[ibus::panel::kUpdatePropertyMethod].Run( | 619 method_callback_map_[ibus::panel::kUpdatePropertyMethod].Run( |
620 &method_call, | 620 &method_call, |
621 base::Bind(&MockResponseSender::Run, | 621 base::Bind(&MockResponseSender::Run, |
622 base::Unretained(&response_sender))); | 622 base::Unretained(&response_sender))); |
623 } | 623 } |
624 | 624 |
625 } // namespace chromeos | 625 } // namespace chromeos |
OLD | NEW |