Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: chromeos/dbus/shill_client_unittest_base.h

Issue 10949030: This converts the Shill clients to allow propagation of shill errors (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Review changes Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const ArgumentCheckCallback& argument_checker, 71 const ArgumentCheckCallback& argument_checker,
72 dbus::Response* response); 72 dbus::Response* response);
73 73
74 // Sends property changed signal to the tested client. 74 // Sends property changed signal to the tested client.
75 void SendPropertyChangedSignal(dbus::Signal* signal); 75 void SendPropertyChangedSignal(dbus::Signal* signal);
76 76
77 // Checks the name and the value which are sent by PropertyChanged signal. 77 // Checks the name and the value which are sent by PropertyChanged signal.
78 static void ExpectPropertyChanged(const std::string& expected_name, 78 static void ExpectPropertyChanged(const std::string& expected_name,
79 const base::Value* expected_value, 79 const base::Value* expected_value,
80 const std::string& name, 80 const std::string& name,
81 const base::Value& value); 81 const base::Value& value);
hashimoto 2012/09/24 02:28:56 nit: Please keep a blank line here.
Greg Spencer (Chromium) 2012/09/24 21:50:54 Done.
82
83 // Expects the reader to be empty. 82 // Expects the reader to be empty.
84 static void ExpectNoArgument(dbus::MessageReader* reader); 83 static void ExpectNoArgument(dbus::MessageReader* reader);
85 84
86 // Expects the reader to have a string. 85 // Expects the reader to have a string.
87 static void ExpectStringArgument(const std::string& expected_string, 86 static void ExpectStringArgument(const std::string& expected_string,
88 dbus::MessageReader* reader); 87 dbus::MessageReader* reader);
89 88
90 // Expects the reader to have a Value. 89 // Expects the reader to have a Value.
91 static void ExpectValueArgument(const base::Value* expected_value, 90 static void ExpectValueArgument(const base::Value* expected_value,
92 dbus::MessageReader* reader); 91 dbus::MessageReader* reader);
93 92
94 // Expects the reader to have a string and a Value. 93 // Expects the reader to have a string and a Value.
95 static void ExpectStringAndValueArguments(const std::string& expected_string, 94 static void ExpectStringAndValueArguments(const std::string& expected_string,
96 const base::Value* expected_value, 95 const base::Value* expected_value,
97 dbus::MessageReader* reader); 96 dbus::MessageReader* reader);
98 97
99 // Expects the call status to be SUCCESS. 98 // Expects the call status to be SUCCESS.
100 static void ExpectNoResultValue(DBusMethodCallStatus call_status); 99 static void ExpectNoResultValue(DBusMethodCallStatus call_status);
101 100
102 // Checks the result and expects the call status to be SUCCESS. 101 // Checks the result and expects the call status to be SUCCESS.
103 static void ExpectObjectPathResult(const dbus::ObjectPath& expected_result, 102 static void ExpectObjectPathResult(const dbus::ObjectPath& expected_result,
104 DBusMethodCallStatus call_status, 103 DBusMethodCallStatus call_status,
105 const dbus::ObjectPath& result); 104 const dbus::ObjectPath& result);
106 105
107 // Checks the result and expects the call status to be SUCCESS. 106 // Checks the result and expects the call status to be SUCCESS.
107 static void ExpectObjectPathResultWithoutStatus(
108 const dbus::ObjectPath& expected_result,
109 const dbus::ObjectPath& result);
110
111 // Checks the result and expects the call status to be SUCCESS.
108 static void ExpectDictionaryValueResult( 112 static void ExpectDictionaryValueResult(
109 const base::DictionaryValue* expected_result, 113 const base::DictionaryValue* expected_result,
110 DBusMethodCallStatus call_status, 114 DBusMethodCallStatus call_status,
111 const base::DictionaryValue& result); 115 const base::DictionaryValue& result);
116 static void ExpectDictionaryValueResultWithoutStatus(
hashimoto 2012/09/24 02:28:56 Please add a blank line and a method comment befor
Greg Spencer (Chromium) 2012/09/24 21:50:54 Done.
117 const base::DictionaryValue* expected_result,
118 const base::DictionaryValue& result);
112 119
113 // A message loop to emulate asynchronous behavior. 120 // A message loop to emulate asynchronous behavior.
114 MessageLoop message_loop_; 121 MessageLoop message_loop_;
115 // The mock bus. 122 // The mock bus.
116 scoped_refptr<dbus::MockBus> mock_bus_; 123 scoped_refptr<dbus::MockBus> mock_bus_;
117 124
118 private: 125 private:
119 // Checks the requested interface name and signal name. 126 // Checks the requested interface name and signal name.
120 // Used to implement the mock proxy. 127 // Used to implement the mock proxy.
121 void OnConnectToSignal( 128 void OnConnectToSignal(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 std::string expected_method_name_; 163 std::string expected_method_name_;
157 // The response which the mock object proxy returns. 164 // The response which the mock object proxy returns.
158 dbus::Response* response_; 165 dbus::Response* response_;
159 // A callback to intercept and check the method call arguments. 166 // A callback to intercept and check the method call arguments.
160 ArgumentCheckCallback argument_checker_; 167 ArgumentCheckCallback argument_checker_;
161 }; 168 };
162 169
163 } // namespace chromeos 170 } // namespace chromeos
164 171
165 #endif // CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_ 172 #endif // CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698