| 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/gsm_sms_client.h" | 5 #include "chromeos/dbus/gsm_sms_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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 // Checks the results of Get and List. | 153 // Checks the results of Get and List. |
| 154 void CheckResult(const base::Value& result) { | 154 void CheckResult(const base::Value& result) { |
| 155 EXPECT_TRUE(result.Equals(expected_result_)); | 155 EXPECT_TRUE(result.Equals(expected_result_)); |
| 156 } | 156 } |
| 157 | 157 |
| 158 protected: | 158 protected: |
| 159 // The client to be tested. | 159 // The client to be tested. |
| 160 scoped_ptr<GsmSMSClient> client_; | 160 scoped_ptr<GsmSMSClient> client_; |
| 161 // A message loop to emulate asynchronous behavior. | 161 // A message loop to emulate asynchronous behavior. |
| 162 MessageLoop message_loop_; | 162 base::MessageLoop message_loop_; |
| 163 // The mock bus. | 163 // The mock bus. |
| 164 scoped_refptr<dbus::MockBus> mock_bus_; | 164 scoped_refptr<dbus::MockBus> mock_bus_; |
| 165 // The mock object proxy. | 165 // The mock object proxy. |
| 166 scoped_refptr<dbus::MockObjectProxy> mock_proxy_; | 166 scoped_refptr<dbus::MockObjectProxy> mock_proxy_; |
| 167 // The SmsReceived signal handler given by the tested client. | 167 // The SmsReceived signal handler given by the tested client. |
| 168 dbus::ObjectProxy::SignalCallback sms_received_callback_; | 168 dbus::ObjectProxy::SignalCallback sms_received_callback_; |
| 169 // Expected argument for Delete and Get methods. | 169 // Expected argument for Delete and Get methods. |
| 170 uint32 expected_index_; | 170 uint32 expected_index_; |
| 171 // Response returned by mock methods. | 171 // Response returned by mock methods. |
| 172 dbus::Response* response_; | 172 dbus::Response* response_; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // Call List. | 315 // Call List. |
| 316 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), | 316 client_->List(kServiceName, dbus::ObjectPath(kObjectPath), |
| 317 base::Bind(&MockListCallback::Run, | 317 base::Bind(&MockListCallback::Run, |
| 318 base::Unretained(&callback))); | 318 base::Unretained(&callback))); |
| 319 | 319 |
| 320 // Run the message loop. | 320 // Run the message loop. |
| 321 message_loop_.RunUntilIdle(); | 321 message_loop_.RunUntilIdle(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace chromeos | 324 } // namespace chromeos |
| OLD | NEW |