shill: EthernetService: Fix auto-connect-by-default

Fix a nasty typo which prevented EthernetService from overriding
the parent class IsAutoConnectByDefault.  Add unit tests.  Add
belt-and-suspenders by also overriding the SetAutoConnect RPC
settter to prevent AutoConnect from being set over the control
interface.

BUG=chromium-os:32709
TEST=Unit tests

Change-Id: I683333b915cb747ccb241512f66d2fb3f1efca3a
Reviewed-on: https://gerrit.chromium.org/gerrit/30557
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/mock_ethernet.h b/mock_ethernet.h
new file mode 100644
index 0000000..75ff789
--- /dev/null
+++ b/mock_ethernet.h
@@ -0,0 +1,43 @@
+// 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_ETHERNET_H_
+#define SHILL_MOCK_ETHERNET_H_
+
+#include <string>
+
+#include <gmock/gmock.h>
+
+#include "shill/refptr_types.h"
+#include "shill/ethernet.h"
+
+namespace shill {
+
+class ControlInterface;
+class Error;
+class EventDispatcher;
+
+class MockEthernet : public Ethernet {
+ public:
+  MockEthernet(ControlInterface *control_interface,
+               EventDispatcher *dispatcher,
+               Metrics *metrics,
+               Manager *manager,
+               const std::string &link_name,
+               const std::string &address,
+               int interface_index);
+  virtual ~MockEthernet();
+
+  MOCK_METHOD2(Start, void(Error *error,
+                           const EnabledStateChangedCallback &callback));
+  MOCK_METHOD2(Stop, void(Error *error,
+                          const EnabledStateChangedCallback &callback));
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MockEthernet);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_MOCK_ETHERNET_H_