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

Unified Diff: chromeos/dbus/shill_client_unittest_base.h

Issue 681723003: Add new shill client for VPN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes nit from Steven Created 6 years, 1 month 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
Index: chromeos/dbus/shill_client_unittest_base.h
diff --git a/chromeos/dbus/shill_client_unittest_base.h b/chromeos/dbus/shill_client_unittest_base.h
index 8eac510605ad0d59d7e57a4d93f4523795361b7a..1c065359ac57d7d6f673cc425d6c8790d9fb8458 100644
--- a/chromeos/dbus/shill_client_unittest_base.h
+++ b/chromeos/dbus/shill_client_unittest_base.h
@@ -13,6 +13,7 @@
#include "chromeos/dbus/dbus_method_call_status.h"
#include "chromeos/dbus/shill_client_helper.h"
#include "chromeos/dbus/shill_property_changed_observer.h"
+#include "chromeos/dbus/shill_third_party_vpn_observer.h"
#include "dbus/mock_bus.h"
#include "dbus/mock_object_proxy.h"
#include "dbus/object_proxy.h"
@@ -114,6 +115,12 @@ class ShillClientUnittestBase : public testing::Test {
const ArgumentCheckCallback& argument_checker,
dbus::Response* response);
+ // Sends platform message signal to the tested client.
+ void SendPlatformMessageSignal(dbus::Signal* signal);
+
+ // Sends packet received signal to the tested client.
+ void SendPacketReceievedSignal(dbus::Signal* signal);
+
// Sends property changed signal to the tested client.
void SendPropertyChangedSignal(dbus::Signal* signal);
@@ -126,6 +133,15 @@ class ShillClientUnittestBase : public testing::Test {
// Expects the reader to be empty.
static void ExpectNoArgument(dbus::MessageReader* reader);
+ // Expects the reader to have a uint32_t
+ static void ExpectUint32Argument(uint32_t expected_value,
+ dbus::MessageReader* reader);
+
+ // Expects the reader to have an array of bytes
+ static void ExpectArrayOfBytesArgument(
+ const std::string& expected_bytes,
+ dbus::MessageReader* reader);
+
// Expects the reader to have a string.
static void ExpectStringArgument(const std::string& expected_string,
dbus::MessageReader* reader);
@@ -146,6 +162,7 @@ class ShillClientUnittestBase : public testing::Test {
// Expects the reader to have a string-to-variant dictionary.
static void ExpectDictionaryValueArgument(
const base::DictionaryValue* expected_dictionary,
+ bool string_valued,
dbus::MessageReader* reader);
// Creates a DictionaryValue with example Service properties. The caller owns
@@ -191,7 +208,23 @@ class ShillClientUnittestBase : public testing::Test {
private:
// Checks the requested interface name and signal name.
// Used to implement the mock proxy.
- void OnConnectToSignal(
+ void OnConnectToPlatformMessage(
+ const std::string& interface_name,
+ const std::string& signal_name,
+ const dbus::ObjectProxy::SignalCallback& signal_callback,
+ const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback);
+
+ // Checks the requested interface name and signal name.
+ // Used to implement the mock proxy.
+ void OnConnectToPacketReceived(
+ const std::string& interface_name,
+ const std::string& signal_name,
+ const dbus::ObjectProxy::SignalCallback& signal_callback,
+ const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback);
+
+ // Checks the requested interface name and signal name.
+ // Used to implement the mock proxy.
+ void OnConnectToPropertyChanged(
const std::string& interface_name,
const std::string& signal_name,
const dbus::ObjectProxy::SignalCallback& signal_callback,
@@ -218,6 +251,10 @@ class ShillClientUnittestBase : public testing::Test {
const dbus::ObjectPath object_path_;
// The mock object proxy.
scoped_refptr<dbus::MockObjectProxy> mock_proxy_;
+ // The PlatformMessage signal handler given by the tested client.
+ dbus::ObjectProxy::SignalCallback platform_message_handler_;
+ // The PacketReceived signal handler given by the tested client.
+ dbus::ObjectProxy::SignalCallback packet_receieved__handler_;
// The PropertyChanged signal handler given by the tested client.
dbus::ObjectProxy::SignalCallback property_changed_handler_;
// The name of the method which is expected to be called.
« no previous file with comments | « chromeos/dbus/fake_shill_third_party_vpn_driver_client.cc ('k') | chromeos/dbus/shill_client_unittest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698