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

Side by Side Diff: dbus/mock_bus.h

Issue 9373039: Allow dbus clients to silence logging when a service is unavailable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use pair, factor out error logging logic Created 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BUS_H_ 5 #ifndef DBUS_MOCK_BUS_H_
6 #define DBUS_MOCK_BUS_H_ 6 #define DBUS_MOCK_BUS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "dbus/bus.h" 9 #include "dbus/bus.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
11 11
12 namespace dbus { 12 namespace dbus {
13 13
14 // Mock for Bus class. Along with MockObjectProxy and MockExportedObject, 14 // Mock for Bus class. Along with MockObjectProxy and MockExportedObject,
15 // the mock classes can be used to write unit tests without issuing real 15 // the mock classes can be used to write unit tests without issuing real
16 // D-Bus calls. 16 // D-Bus calls.
17 class MockBus : public Bus { 17 class MockBus : public Bus {
18 public: 18 public:
19 MockBus(Bus::Options& options); 19 MockBus(Bus::Options& options);
20 virtual ~MockBus(); 20 virtual ~MockBus();
21 21
22 MOCK_METHOD2(GetObjectProxy, ObjectProxy*(const std::string& service_name, 22 MOCK_METHOD2(GetObjectProxy, ObjectProxy*(const std::string& service_name,
23 const std::string& object_path)); 23 const std::string& object_path));
24 MOCK_METHOD3(GetObjectProxyWithOptions,
25 ObjectProxy*(const std::string& service_name,
26 const std::string& object_path,
27 int options));
24 MOCK_METHOD2(GetExportedObject, ExportedObject*( 28 MOCK_METHOD2(GetExportedObject, ExportedObject*(
25 const std::string& service_name, 29 const std::string& service_name,
26 const std::string& object_path)); 30 const std::string& object_path));
27 MOCK_METHOD0(ShutdownAndBlock, void()); 31 MOCK_METHOD0(ShutdownAndBlock, void());
28 MOCK_METHOD0(ShutdownOnDBusThreadAndBlock, void()); 32 MOCK_METHOD0(ShutdownOnDBusThreadAndBlock, void());
29 MOCK_METHOD0(Connect, bool()); 33 MOCK_METHOD0(Connect, bool());
30 MOCK_METHOD1(RequestOwnership, bool(const std::string& service_name)); 34 MOCK_METHOD1(RequestOwnership, bool(const std::string& service_name));
31 MOCK_METHOD1(ReleaseOwnership, bool(const std::string& service_name)); 35 MOCK_METHOD1(ReleaseOwnership, bool(const std::string& service_name));
32 MOCK_METHOD0(SetUpAsyncOperations, bool()); 36 MOCK_METHOD0(SetUpAsyncOperations, bool());
33 MOCK_METHOD3(SendWithReplyAndBlock, DBusMessage*(DBusMessage* request, 37 MOCK_METHOD3(SendWithReplyAndBlock, DBusMessage*(DBusMessage* request,
(...skipping 28 matching lines...) Expand all
62 const base::Closure& task, 66 const base::Closure& task,
63 int delay_ms)); 67 int delay_ms));
64 MOCK_METHOD0(HasDBusThread, bool()); 68 MOCK_METHOD0(HasDBusThread, bool());
65 MOCK_METHOD0(AssertOnOriginThread, void()); 69 MOCK_METHOD0(AssertOnOriginThread, void());
66 MOCK_METHOD0(AssertOnDBusThread, void()); 70 MOCK_METHOD0(AssertOnDBusThread, void());
67 }; 71 };
68 72
69 } // namespace dbus 73 } // namespace dbus
70 74
71 #endif // DBUS_MOCK_BUS_H_ 75 #endif // DBUS_MOCK_BUS_H_
OLDNEW
« no previous file with comments | « dbus/bus_unittest.cc ('k') | dbus/mock_object_proxy.cc » ('j') | dbus/object_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698