| 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 #ifndef CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ | 5 #ifndef CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ |
| 6 #define CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ | 6 #define CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 const base::DictionaryValue* expected_result, | 168 const base::DictionaryValue* expected_result, |
| 169 DBusMethodCallStatus call_status, | 169 DBusMethodCallStatus call_status, |
| 170 const base::DictionaryValue& result); | 170 const base::DictionaryValue& result); |
| 171 | 171 |
| 172 // Expects the |expected_result| to match the |result|. | 172 // Expects the |expected_result| to match the |result|. |
| 173 static void ExpectDictionaryValueResultWithoutStatus( | 173 static void ExpectDictionaryValueResultWithoutStatus( |
| 174 const base::DictionaryValue* expected_result, | 174 const base::DictionaryValue* expected_result, |
| 175 const base::DictionaryValue& result); | 175 const base::DictionaryValue& result); |
| 176 | 176 |
| 177 // A message loop to emulate asynchronous behavior. | 177 // A message loop to emulate asynchronous behavior. |
| 178 MessageLoop message_loop_; | 178 base::MessageLoop message_loop_; |
| 179 // The mock bus. | 179 // The mock bus. |
| 180 scoped_refptr<dbus::MockBus> mock_bus_; | 180 scoped_refptr<dbus::MockBus> mock_bus_; |
| 181 | 181 |
| 182 private: | 182 private: |
| 183 // Checks the requested interface name and signal name. | 183 // Checks the requested interface name and signal name. |
| 184 // Used to implement the mock proxy. | 184 // Used to implement the mock proxy. |
| 185 void OnConnectToSignal( | 185 void OnConnectToSignal( |
| 186 const std::string& interface_name, | 186 const std::string& interface_name, |
| 187 const std::string& signal_name, | 187 const std::string& signal_name, |
| 188 const dbus::ObjectProxy::SignalCallback& signal_callback, | 188 const dbus::ObjectProxy::SignalCallback& signal_callback, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 std::string expected_method_name_; | 220 std::string expected_method_name_; |
| 221 // The response which the mock object proxy returns. | 221 // The response which the mock object proxy returns. |
| 222 dbus::Response* response_; | 222 dbus::Response* response_; |
| 223 // A callback to intercept and check the method call arguments. | 223 // A callback to intercept and check the method call arguments. |
| 224 ArgumentCheckCallback argument_checker_; | 224 ArgumentCheckCallback argument_checker_; |
| 225 }; | 225 }; |
| 226 | 226 |
| 227 } // namespace chromeos | 227 } // namespace chromeos |
| 228 | 228 |
| 229 #endif // CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ | 229 #endif // CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ |
| OLD | NEW |