shill: add unittests for wifi
BUG=chromium-os:16785,chromium-os:16419
TEST=FEATURES="test nostrip noclean" emerge-x86-generic shill
Change-Id: I2a681a8f3ab291089d4622dabbbbd1a6ec42bdb8
Reviewed-on: http://gerrit.chromium.org/gerrit/4411
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
diff --git a/mock_supplicant_interface_proxy.h b/mock_supplicant_interface_proxy.h
new file mode 100644
index 0000000..ea69639
--- /dev/null
+++ b/mock_supplicant_interface_proxy.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium OS 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 MOCK_SUPPLICANT_INTERFACE_PROXY_H_
+#define MOCK_SUPPLICANT_INTERFACE_PROXY_H_
+
+#include <gmock/gmock.h>
+
+#include "shill/supplicant_interface_proxy_interface.h"
+
+namespace shill {
+
+class MockSupplicantInterfaceProxy : public SupplicantInterfaceProxyInterface {
+ public:
+ explicit MockSupplicantInterfaceProxy(const WiFiRefPtr &wifi) :
+ wifi_(wifi) {}
+ virtual ~MockSupplicantInterfaceProxy() {}
+
+ MOCK_METHOD1(AddNetwork, ::DBus::Path(
+ const std::map<std::string, ::DBus::Variant> &args));
+ MOCK_METHOD1(FlushBSS, void(const uint32_t &age));
+ MOCK_METHOD0(RemoveAllNetworks, void());
+ MOCK_METHOD1(Scan,
+ void(const std::map<std::string, ::DBus::Variant> &args));
+ MOCK_METHOD1(SelectNetwork, void(const ::DBus::Path &network));
+
+ private:
+ // wifi_ is not used explicitly. but its presence here tests that
+ // WiFi::Stop properly removes cyclic references.
+ WiFiRefPtr wifi_;
+ DISALLOW_COPY_AND_ASSIGN(MockSupplicantInterfaceProxy);
+};
+
+} // namespace shill
+
+#endif // MOCK_SUPPLICANT_INTERFACE_PROXY_H_