shill: Notify upstart when shill is offline

Add an Upstart proxy, which can ask the upstart process to emit
events.  Invoke this event whenever the shill manager becomes
idle.

BUG=chromium:447796
TEST=Unit tests + manual:
Create a dummy "offline.conf" file in /etc/init which starts
with "start on shill-disconnected", and ensure that this script
is invoked if we disconnect the network.

Change-Id: Ide473098b7b93fd3da57b820e78b0a710c287cba
Reviewed-on: https://chromium-review.googlesource.com/241033
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/upstart/mock_upstart_proxy.h b/upstart/mock_upstart_proxy.h
new file mode 100644
index 0000000..1bd84d0
--- /dev/null
+++ b/upstart/mock_upstart_proxy.h
@@ -0,0 +1,34 @@
+// 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_UPSTART_MOCK_UPSTART_PROXY_H_
+#define SHILL_UPSTART_MOCK_UPSTART_PROXY_H_
+
+#include <string>
+#include <vector>
+
+#include <base/macros.h>
+#include <gmock/gmock.h>
+
+#include "shill/upstart/upstart_proxy_interface.h"
+
+namespace shill {
+
+class MockUpstartProxy : public UpstartProxyInterface {
+ public:
+  MockUpstartProxy();
+  ~MockUpstartProxy() override;
+
+  MOCK_METHOD3(EmitEvent,
+               void(const std::string &name,
+                    const std::vector<std::string> &env,
+                    bool wait));
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(MockUpstartProxy);
+};
+
+}  // namespace shill
+
+#endif  // SHILL_UPSTART_MOCK_UPSTART_PROXY_H_