1From eadafb5815145a401cbfa6da559de01cb35d3a2b Mon Sep 17 00:00:00 2001
2From: Qijiang Fan <fqj@chromium.org>
3Date: Tue, 17 Dec 2019 17:21:54 +0900
4Subject: [PATCH 3/5] mock object proxy WaitForServiceToBeAvailable
5
6Change-Id: I01d2e49547f0e9083df60de69ef254761de2c00e
7---
8 dbus/mock_object_proxy.cc | 5 +++++
9 dbus/mock_object_proxy.h  | 6 +++++++
10 2 files changed, 11 insertions(+)
11
12diff --git a/dbus/mock_object_proxy.cc b/dbus/mock_object_proxy.cc
13index 4929486..a1f2edd 100644
14--- a/dbus/mock_object_proxy.cc
15+++ b/dbus/mock_object_proxy.cc
16@@ -45,4 +45,9 @@ void MockObjectProxy::ConnectToSignal(
17                     &on_connected_callback);
18 }
19
20+void MockObjectProxy::WaitForServiceToBeAvailable(
21+    WaitForServiceToBeAvailableCallback callback) {
22+  DoWaitForServiceToBeAvailable(&callback);
23+}
24+
25 }  // namespace dbus
26diff --git a/dbus/mock_object_proxy.h b/dbus/mock_object_proxy.h
27index 7bc2376..abc793a 100644
28--- a/dbus/mock_object_proxy.h
29+++ b/dbus/mock_object_proxy.h
30@@ -89,6 +90,12 @@ class MockObjectProxy : public ObjectProxy {
31                     OnConnectedCallback* on_connected_callback));
32   MOCK_METHOD1(SetNameOwnerChangedCallback,
33                void(NameOwnerChangedCallback callback));
34+  // This method is not mockable because it takes a move-only argument. To work
35+  // around this. WaitForServiceToBeAvailable implements here calls
36+  // DoWaitForServiceToBeAvailable which is mockable.
37+  void WaitForServiceToBeAvailable(WaitForServiceToBeAvailableCallback callback) override;
38+  MOCK_METHOD1(DoWaitForServiceToBeAvailable,
39+               void(WaitForServiceToBeAvailableCallback* callback));
40   MOCK_METHOD0(Detach, void());
41
42  protected:
43--
442.24.1.735.g03f4e72817-goog
45
46