| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 // Checks the result and expects the call status to be SUCCESS. | 142 // Checks the result and expects the call status to be SUCCESS. |
| 143 static void ExpectObjectPathResultWithoutStatus( | 143 static void ExpectObjectPathResultWithoutStatus( |
| 144 const dbus::ObjectPath& expected_result, | 144 const dbus::ObjectPath& expected_result, |
| 145 const dbus::ObjectPath& result); | 145 const dbus::ObjectPath& result); |
| 146 | 146 |
| 147 // Checks the result and expects the call status to be SUCCESS. | 147 // Checks the result and expects the call status to be SUCCESS. |
| 148 static void ExpectDictionaryValueResult( | 148 static void ExpectDictionaryValueResult( |
| 149 const base::DictionaryValue* expected_result, | 149 const base::DictionaryValue* expected_result, |
| 150 DBusMethodCallStatus call_status, | 150 DBusMethodCallStatus call_status, |
| 151 const base::DictionaryValue& result); | 151 scoped_ptr<base::DictionaryValue> result); |
| 152 | 152 |
| 153 // Expects the |expected_result| to match the |result|. | 153 // Expects the |expected_result| to match the |result|. |
| 154 static void ExpectDictionaryValueResultWithoutStatus( | 154 static void ExpectDictionaryValueResultWithoutStatus( |
| 155 const base::DictionaryValue* expected_result, | 155 const base::DictionaryValue* expected_result, |
| 156 const base::DictionaryValue& result); | 156 scoped_ptr<base::DictionaryValue> result); |
| 157 | 157 |
| 158 // A message loop to emulate asynchronous behavior. | 158 // A message loop to emulate asynchronous behavior. |
| 159 MessageLoop message_loop_; | 159 MessageLoop message_loop_; |
| 160 // The mock bus. | 160 // The mock bus. |
| 161 scoped_refptr<dbus::MockBus> mock_bus_; | 161 scoped_refptr<dbus::MockBus> mock_bus_; |
| 162 | 162 |
| 163 private: | 163 private: |
| 164 // Checks the requested interface name and signal name. | 164 // Checks the requested interface name and signal name. |
| 165 // Used to implement the mock proxy. | 165 // Used to implement the mock proxy. |
| 166 void OnConnectToSignal( | 166 void OnConnectToSignal( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 std::string expected_method_name_; | 201 std::string expected_method_name_; |
| 202 // The response which the mock object proxy returns. | 202 // The response which the mock object proxy returns. |
| 203 dbus::Response* response_; | 203 dbus::Response* response_; |
| 204 // A callback to intercept and check the method call arguments. | 204 // A callback to intercept and check the method call arguments. |
| 205 ArgumentCheckCallback argument_checker_; | 205 ArgumentCheckCallback argument_checker_; |
| 206 }; | 206 }; |
| 207 | 207 |
| 208 } // namespace chromeos | 208 } // namespace chromeos |
| 209 | 209 |
| 210 #endif // CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ | 210 #endif // CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ |
| OLD | NEW |