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