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/modem_messaging_client.h" | 5 #include "chromeos/dbus/modem_messaging_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 "dbus/message.h" | 10 #include "dbus/message.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 // Checks the results of List. | 131 // Checks the results of List. |
132 void CheckResult(const std::vector<dbus::ObjectPath>& result) { | 132 void CheckResult(const std::vector<dbus::ObjectPath>& result) { |
133 EXPECT_EQ(result, *expected_result_); | 133 EXPECT_EQ(result, *expected_result_); |
134 } | 134 } |
135 | 135 |
136 protected: | 136 protected: |
137 // The client to be tested. | 137 // The client to be tested. |
138 scoped_ptr<ModemMessagingClient> client_; | 138 scoped_ptr<ModemMessagingClient> client_; |
139 // A message loop to emulate asynchronous behavior. | 139 // A message loop to emulate asynchronous behavior. |
140 MessageLoop message_loop_; | 140 base::MessageLoop message_loop_; |
141 // The mock bus. | 141 // The mock bus. |
142 scoped_refptr<dbus::MockBus> mock_bus_; | 142 scoped_refptr<dbus::MockBus> mock_bus_; |
143 // The mock object proxy. | 143 // The mock object proxy. |
144 scoped_refptr<dbus::MockObjectProxy> mock_proxy_; | 144 scoped_refptr<dbus::MockObjectProxy> mock_proxy_; |
145 // The SmsReceived signal handler given by the tested client. | 145 // The SmsReceived signal handler given by the tested client. |
146 dbus::ObjectProxy::SignalCallback sms_received_callback_; | 146 dbus::ObjectProxy::SignalCallback sms_received_callback_; |
147 // Expected argument for Delete method. | 147 // Expected argument for Delete method. |
148 dbus::ObjectPath expected_sms_path_; | 148 dbus::ObjectPath expected_sms_path_; |
149 // Response returned by mock methods. | 149 // Response returned by mock methods. |
150 dbus::Response* response_; | 150 dbus::Response* response_; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // Call List. | 239 // Call List. |
240 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), | 240 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), |
241 base::Bind(&MockListCallback::Run, | 241 base::Bind(&MockListCallback::Run, |
242 base::Unretained(&callback))); | 242 base::Unretained(&callback))); |
243 | 243 |
244 // Run the message loop. | 244 // Run the message loop. |
245 message_loop_.RunUntilIdle(); | 245 message_loop_.RunUntilIdle(); |
246 } | 246 } |
247 | 247 |
248 } // namespace chromeos | 248 } // namespace chromeos |
OLD | NEW |