| 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..4460e1223711bc9bb72c075189f709f91ef702dd 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"
|
| @@ -97,6 +98,14 @@ class ShillClientUnittestBase : public testing::Test {
|
| const base::Value& value));
|
| };
|
|
|
| + class MockShillThirdPartyVpnObserver : public ShillThirdPartyVpnObserver {
|
| + public:
|
| + MockShillThirdPartyVpnObserver();
|
| + ~MockShillThirdPartyVpnObserver();
|
| + MOCK_METHOD2(OnPacketReceived, void(const uint8* data, size_t length));
|
| + MOCK_METHOD1(OnPlatformMessage, void(uint32 message));
|
| + };
|
| +
|
| explicit ShillClientUnittestBase(const std::string& interface_name,
|
| const dbus::ObjectPath& object_path);
|
| virtual ~ShillClientUnittestBase();
|
| @@ -114,6 +123,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 +141,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
|
| + static void ExpectUint32Argument(uint32 expected_value,
|
| + dbus::MessageReader* reader);
|
| +
|
| + // Expects the reader to have an array of bytes
|
| + static void ExpectArrayOfBytesArgument(
|
| + const std::vector<uint8>& 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 +170,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 +216,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 OnConnectToPacketReceieved(
|
| + 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 +259,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.
|
|
|