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

Side by Side Diff: dbus/mock_object_proxy.h

Issue 12092061: Code cleaning: Uses scoped_ptr<> to express ownership rather than writing ownership in comments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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 DBUS_MOCK_OBJECT_PROXY_H_ 5 #ifndef DBUS_MOCK_OBJECT_PROXY_H_
6 #define DBUS_MOCK_OBJECT_PROXY_H_ 6 #define DBUS_MOCK_OBJECT_PROXY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "dbus/message.h"
10 #include "dbus/object_path.h" 11 #include "dbus/object_path.h"
11 #include "dbus/object_proxy.h" 12 #include "dbus/object_proxy.h"
12 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
13 14
14 namespace dbus { 15 namespace dbus {
15 16
16 // Mock for ObjectProxy. 17 // Mock for ObjectProxy.
17 class MockObjectProxy : public ObjectProxy { 18 class MockObjectProxy : public ObjectProxy {
18 public: 19 public:
19 MockObjectProxy(Bus* bus, 20 MockObjectProxy(Bus* bus,
20 const std::string& service_name, 21 const std::string& service_name,
21 const ObjectPath& object_path); 22 const ObjectPath& object_path);
22 23
23 MOCK_METHOD2(CallMethodAndBlock, Response*(MethodCall* method_call, 24 MOCK_METHOD2(MockCallMethodAndBlock, Response*(MethodCall* method_call,
satorux1 2013/01/30 06:36:58 I guess this indirection is needed because CallMet
alias of yukishiino 2013/01/30 13:13:44 Done.
24 int timeout_ms)); 25 int timeout_ms));
26 virtual scoped_ptr<Response> CallMethodAndBlock(MethodCall* method_call,
27 int timeout_ms) OVERRIDE {
28 return scoped_ptr<Response>(MockCallMethodAndBlock(method_call,
29 timeout_ms));
30 }
25 MOCK_METHOD3(CallMethod, void(MethodCall* method_call, 31 MOCK_METHOD3(CallMethod, void(MethodCall* method_call,
26 int timeout_ms, 32 int timeout_ms,
27 ResponseCallback callback)); 33 ResponseCallback callback));
28 MOCK_METHOD4(CallMethodWithErrorCallback, void(MethodCall* method_call, 34 MOCK_METHOD4(CallMethodWithErrorCallback, void(MethodCall* method_call,
29 int timeout_ms, 35 int timeout_ms,
30 ResponseCallback callback, 36 ResponseCallback callback,
31 ErrorCallback error_callback)); 37 ErrorCallback error_callback));
32 MOCK_METHOD4(ConnectToSignal, 38 MOCK_METHOD4(ConnectToSignal,
33 void(const std::string& interface_name, 39 void(const std::string& interface_name,
34 const std::string& signal_name, 40 const std::string& signal_name,
35 SignalCallback signal_callback, 41 SignalCallback signal_callback,
36 OnConnectedCallback on_connected_callback)); 42 OnConnectedCallback on_connected_callback));
37 MOCK_METHOD0(Detach, void()); 43 MOCK_METHOD0(Detach, void());
38 44
39 protected: 45 protected:
40 virtual ~MockObjectProxy(); 46 virtual ~MockObjectProxy();
41 }; 47 };
42 48
43 } // namespace dbus 49 } // namespace dbus
44 50
45 #endif // DBUS_MOCK_OBJECT_PROXY_H_ 51 #endif // DBUS_MOCK_OBJECT_PROXY_H_
OLDNEW
« dbus/message.h ('K') | « dbus/message.cc ('k') | dbus/object_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698