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

Unified Diff: chromeos/dbus/flimflam_client_unittest_base.h

Issue 10170020: Rework chromeos::FlimflamDevice/ServiceClient with CallMethodWithErrorCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/dbus/flimflam_client_helper.cc ('k') | chromeos/dbus/flimflam_client_unittest_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/flimflam_client_unittest_base.h
diff --git a/chromeos/dbus/flimflam_client_unittest_base.h b/chromeos/dbus/flimflam_client_unittest_base.h
index 82b9e5e4348db8179d845111aed9af68cd699d5d..68ac59ca11e97b391d12eb2fabd6182ea902eaed 100644
--- a/chromeos/dbus/flimflam_client_unittest_base.h
+++ b/chromeos/dbus/flimflam_client_unittest_base.h
@@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "chromeos/dbus/dbus_method_call_status.h"
+#include "chromeos/dbus/flimflam_client_helper.h"
#include "dbus/mock_bus.h"
#include "dbus/mock_object_proxy.h"
#include "dbus/object_proxy.h"
@@ -34,6 +35,25 @@ namespace chromeos {
// A class to provide functionalities needed for testing Flimflam D-Bus clients.
class FlimflamClientUnittestBase : public testing::Test {
public:
+ // A mock Closure.
+ class MockClosure {
+ public:
+ MockClosure();
+ ~MockClosure();
+ MOCK_METHOD0(Run, void());
+ base::Closure GetCallback();
+ };
+
+ // A mock ErrorCallback.
+ class MockErrorCallback {
+ public:
+ MockErrorCallback();
+ ~MockErrorCallback();
+ MOCK_METHOD2(Run, void(const std::string& error_name,
+ const std::string& error_mesage));
+ FlimflamClientHelper::ErrorCallback GetCallback();
+ };
+
explicit FlimflamClientUnittestBase(const std::string& interface_name,
const dbus::ObjectPath& object_path);
virtual ~FlimflamClientUnittestBase();
@@ -113,6 +133,14 @@ class FlimflamClientUnittestBase : public testing::Test {
// Checks the content of the method call and returns the response.
// Used to implement the mock proxy.
+ void OnCallMethodWithErrorCallback(
+ dbus::MethodCall* method_call,
+ int timeout_ms,
+ const dbus::ObjectProxy::ResponseCallback& response_callback,
+ const dbus::ObjectProxy::ErrorCallback& error_callback);
+
+ // Checks the content of the method call and returns the response.
+ // Used to implement the mock proxy.
dbus::Response* OnCallMethodAndBlock(dbus::MethodCall* method_call,
int timeout_ms);
« no previous file with comments | « chromeos/dbus/flimflam_client_helper.cc ('k') | chromeos/dbus/flimflam_client_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698