shill: track wpa_supplicant state, and use it
to update Service state

BUG=chromium-os:22594
TEST=unittests, manual

Manual testing: tried network_WiFiRoaming.002Suspend,
but this still fails. The reason is that we ignore
transitions into disconnected state. I'll address that
in a separate patch, which will add tracking of
CurrentBSS.

Bonus changes bundled in this commit:
- fix some comments (capitalization/punctuation,
  XXX -> TODO)
- WiFiMainTest::InitateConnect arg changed from bare pointer
  to refptr

Change-Id: I6c42f9794c8742fa2b46d03a54d77e0545c899c5
Reviewed-on: https://gerrit.chromium.org/gerrit/11460
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/mock_wifi_service.h b/mock_wifi_service.h
new file mode 100644
index 0000000..a0d4ace
--- /dev/null
+++ b/mock_wifi_service.h
@@ -0,0 +1,34 @@
+// 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 SHILL_MOCK_WIFI_SERVICE_
+#define SHILL_MOCK_WIFI_SERVICE_
+
+#include <gmock/gmock.h>
+
+#include "shill/wifi_service.h"
+
+namespace shill {
+
+class MockWiFiService : public WiFiService {
+ public:
+  MockWiFiService(ControlInterface *control_interface,
+                  EventDispatcher *dispatcher,
+                  Manager *manager,
+                  const WiFiRefPtr &device,
+                  const std::vector<uint8_t> &ssid,
+                  const std::string &mode,
+                  const std::string &security,
+                  bool hidden_ssid);
+  virtual ~MockWiFiService();
+
+  MOCK_METHOD1(SetState, void(ConnectState state));
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MockWiFiService);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_MOCK_WIFI_SERVICE_