AU: disable GPIOs in production; some structural changes
Since we are not making use of the GPIO funcionality in UE for the
moment, it's been advised that it should be disabled. This CL does just
that, plus a few small changes:
* Adds a "no-op" GPIO implementation, which simply returns a constant
value every time it's being asked whether test-mode was signaled (in
this case, we set it to return false).
* The GPIO handler is embedded in SystemState. This makes sense from
both the conceptual and usability standpoint. The SystemState object
can be parametrized to initialize either a real or a no-op GPIO
handler.
BUG=chromium-os:32263
TEST=passes unit tests; does not engage GPIO protocol on x86-alex
Change-Id: I8121647baa7611041073dcf305beddab57c0e49c
Reviewed-on: https://gerrit.chromium.org/gerrit/40633
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/mock_gpio_handler.h b/mock_gpio_handler.h
new file mode 100644
index 0000000..bee1cf6
--- /dev/null
+++ b/mock_gpio_handler.h
@@ -0,0 +1,20 @@
+// Copyright (c) 2013 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_GPIO_HANDLER_H__
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_GPIO_HANDLER_H__
+
+#include "gmock/gmock.h"
+#include "update_engine/gpio_handler.h"
+
+namespace chromeos_update_engine {
+
+class MockGpioHandler: public GpioHandler {
+ public:
+ MOCK_METHOD0(IsTestModeSignaled, bool());
+};
+
+} // namespace chromeos_update_engine
+
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_GPIO_HANDLER_H__