| 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_client.h" | 5 #include "chromeos/dbus/ibus/ibus_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chromeos/dbus/ibus/ibus_constants.h" | 10 #include "chromeos/dbus/ibus/ibus_constants.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 message_loop_.PostTask(FROM_HERE, base::Bind(error_callback, | 70 message_loop_.PostTask(FROM_HERE, base::Bind(error_callback, |
| 71 error_response_)); | 71 error_response_)); |
| 72 } | 72 } |
| 73 | 73 |
| 74 protected: | 74 protected: |
| 75 virtual void SetUp() OVERRIDE { | 75 virtual void SetUp() OVERRIDE { |
| 76 dbus::Bus::Options options; | 76 dbus::Bus::Options options; |
| 77 mock_bus_ = new dbus::MockBus(options); | 77 mock_bus_ = new dbus::MockBus(options); |
| 78 mock_proxy_ = new dbus::MockObjectProxy(mock_bus_.get(), | 78 mock_proxy_ = new dbus::MockObjectProxy(mock_bus_.get(), |
| 79 kIBusServiceName, | 79 ibus::kServiceName, |
| 80 dbus::ObjectPath(kIBusServicePath)); | 80 dbus::ObjectPath( |
| 81 EXPECT_CALL(*mock_bus_, GetObjectProxy(kIBusServiceName, | 81 ibus::bus::kServicePath)); |
| 82 dbus::ObjectPath(kIBusServicePath))) | 82 EXPECT_CALL(*mock_bus_, GetObjectProxy(ibus::kServiceName, |
| 83 dbus::ObjectPath( |
| 84 ibus::bus::kServicePath))) |
| 83 .WillOnce(Return(mock_proxy_.get())); | 85 .WillOnce(Return(mock_proxy_.get())); |
| 84 | 86 |
| 85 EXPECT_CALL(*mock_bus_, ShutdownAndBlock()); | 87 EXPECT_CALL(*mock_bus_, ShutdownAndBlock()); |
| 86 client_.reset(IBusClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, | 88 client_.reset(IBusClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION, |
| 87 mock_bus_)); | 89 mock_bus_)); |
| 88 } | 90 } |
| 89 | 91 |
| 90 virtual void TearDown() OVERRIDE { | 92 virtual void TearDown() OVERRIDE { |
| 91 mock_bus_->ShutdownAndBlock(); | 93 mock_bus_->ShutdownAndBlock(); |
| 92 } | 94 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 base::Bind(&MockCreateInputContextCallback::Run, | 202 base::Bind(&MockCreateInputContextCallback::Run, |
| 201 base::Unretained(&callback)), | 203 base::Unretained(&callback)), |
| 202 base::Bind(&MockCreateInputContextErrorCallback::Run, | 204 base::Bind(&MockCreateInputContextErrorCallback::Run, |
| 203 base::Unretained(&error_callback))); | 205 base::Unretained(&error_callback))); |
| 204 | 206 |
| 205 // Run the message loop. | 207 // Run the message loop. |
| 206 message_loop_.RunAllPending(); | 208 message_loop_.RunAllPending(); |
| 207 } | 209 } |
| 208 | 210 |
| 209 } // namespace chromeos | 211 } // namespace chromeos |
| OLD | NEW |