shill: add MockIcmpSession, IcmpSessionFactory, and MockIcmpSessionFactory

Add MockIcmpSession class that allows for mocking of
IcmpSession function calls. Add an IcmpSessionFactory and
a corresponding Mock of this factory to allow IcmpSessions
that are dynamically allocated within a class implementation
to be mocked in unit tests.

A forthcoming CL will use these classes for testing.

BUG=None
TEST=Compiling shill for unit tests succeeds.

Change-Id: Ic327a19229d25146abf62f2228782b1826b186e7
Reviewed-on: https://chromium-review.googlesource.com/289954
Tested-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
diff --git a/mock_icmp_session.h b/mock_icmp_session.h
new file mode 100644
index 0000000..987a131
--- /dev/null
+++ b/mock_icmp_session.h
@@ -0,0 +1,33 @@
+// Copyright 2015 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 SHILL_MOCK_ICMP_SESSION_H_
+#define SHILL_MOCK_ICMP_SESSION_H_
+
+#include "shill/icmp_session.h"
+
+#include <gmock/gmock.h>
+
+#include "shill/net/ip_address.h"
+
+namespace shill {
+
+class MockIcmpSession : public IcmpSession {
+ public:
+  explicit MockIcmpSession(EventDispatcher* dispatcher);
+  ~MockIcmpSession() override;
+
+  MOCK_METHOD2(
+      Start,
+      bool(const IPAddress& destination,
+           const IcmpSession::IcmpSessionResultCallback& result_callback));
+  MOCK_METHOD0(Stop, void());
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MockIcmpSession);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_MOCK_ICMP_SESSION_H_