shill: portal: Recheck portal state

Introduce a retry interval for automatically retrying portal
checks.  Also provide a Manager API method for immediately
re-checking portal status.

BUG=chromium-os:27335
TEST=New unit tests, tested on real machine, including setting
PortaCheckInterval over DBus, and using Jason's addition to
test-flimflam for 'recheck-portal'.
Change-Id: Idc7def18c6f863859e94f4d4e9f266ab2670679c
Reviewed-on: https://gerrit.chromium.org/gerrit/17367
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/mock_portal_detector.h b/mock_portal_detector.h
new file mode 100644
index 0000000..9a15eb9
--- /dev/null
+++ b/mock_portal_detector.h
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 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_PORTAL_DETECTOR_H_
+#define SHILL_MOCK_PORTAL_DETECTOR_H_
+
+#include <base/basictypes.h>
+#include <gmock/gmock.h>
+
+#include "shill/portal_detector.h"
+
+namespace shill {
+
+class MockPortalDetector : public PortalDetector {
+ public:
+  MockPortalDetector(ConnectionRefPtr connection);
+  virtual ~MockPortalDetector();
+
+  MOCK_METHOD1(Start, bool(const std::string &));
+  MOCK_METHOD2(StartAfterDelay, bool(const std::string &, int delay_seconds));
+  MOCK_METHOD0(Stop, void());
+  MOCK_METHOD0(IsInProgress, bool());
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MockPortalDetector);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_MOCK_PORTAL_DETECTOR_H_