summaryrefslogtreecommitdiffstats
path: root/dbus
diff options
context:
space:
mode:
authorharuki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 07:30:59 +0000
committerharuki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 07:30:59 +0000
commit9cf45f5176cdda3b5f9d5cdd26cb9ac5d1901515 (patch)
treee450d93cc2f99748d73fca828493e43f45196c20 /dbus
parent30551e71ac3439ef7a1a7c19ee3be0982ab81416 (diff)
downloadchromium_src-9cf45f5176cdda3b5f9d5cdd26cb9ac5d1901515.zip
chromium_src-9cf45f5176cdda3b5f9d5cdd26cb9ac5d1901515.tar.gz
chromium_src-9cf45f5176cdda3b5f9d5cdd26cb9ac5d1901515.tar.bz2
dbus: Add FakeBus
BUG=234078 TEST=trybots Review URL: https://chromiumcodereview.appspot.com/14493004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196352 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus.gyp6
-rw-r--r--dbus/fake_bus.cc17
-rw-r--r--dbus/fake_bus.h23
3 files changed, 44 insertions, 2 deletions
diff --git a/dbus/dbus.gyp b/dbus/dbus.gyp
index 847e7d97..3f41238 100644
--- a/dbus/dbus.gyp
+++ b/dbus/dbus.gyp
@@ -59,8 +59,8 @@
'includes': [ '../build/protoc.gypi' ],
},
{
- # This target contains mocks that can be used to write unit tests
- # without issuing actual D-Bus calls.
+ # This target contains mocks and fakes that can be used to write unit
+ # tests without issuing actual D-Bus calls.
'target_name': 'dbus_test_support',
'type': 'static_library',
'dependencies': [
@@ -69,6 +69,8 @@
'dbus',
],
'sources': [
+ 'fake_bus.cc',
+ 'fake_bus.h',
'mock_bus.cc',
'mock_bus.h',
'mock_exported_object.cc',
diff --git a/dbus/fake_bus.cc b/dbus/fake_bus.cc
new file mode 100644
index 0000000..a93772c
--- /dev/null
+++ b/dbus/fake_bus.cc
@@ -0,0 +1,17 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "dbus/fake_bus.h"
+
+#include "base/location.h"
+
+namespace dbus {
+
+FakeBus::FakeBus(const Bus::Options& options) : Bus(options) {
+}
+
+FakeBus::~FakeBus() {
+}
+
+} // namespace dbus
diff --git a/dbus/fake_bus.h b/dbus/fake_bus.h
new file mode 100644
index 0000000..743e362
--- /dev/null
+++ b/dbus/fake_bus.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DBUS_FAKE_BUS_H_
+#define DBUS_FAKE_BUS_H_
+
+#include "dbus/bus.h"
+
+namespace dbus {
+
+// A fake implementation of Bus, which does nothing.
+class FakeBus : public Bus {
+ public:
+ FakeBus(const Bus::Options& options);
+
+ protected:
+ virtual ~FakeBus();
+};
+
+} // namespace dbus
+
+#endif // DBUS_FAKE_BUS_H_