Bidirectional test mode signaling over GPIO

* Implements a bidirectional synchronous handshake protocol over
  dut_flaga/b GPIOs. This protocol is designed to return true (test
  mode) only if the DUT is connected to a servo board which implements
  the remote end.

* Includes unit tests for the test mode signaling routine, complete with
  mock/fake implementation of the remote end.

Note that we still do not deploy GpioHandler in actual update
processing, which will be done later.

BUG=chromium-os:25397,chromium-os:27109,chromium-os:27672
TEST=Builds and passes unit tests (including new ones)

Change-Id: I265407ed735c3e1354e10782ac30566b16caeb20
Reviewed-on: https://gerrit.chromium.org/gerrit/23330
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Gilad Arnold <garnold@chromium.org>
diff --git a/gpio_handler_unittest.h b/gpio_handler_unittest.h
index 5780eaa..c98e248 100644
--- a/gpio_handler_unittest.h
+++ b/gpio_handler_unittest.h
@@ -26,6 +26,20 @@
   kMockGpioIdMax  // marker, do not remove!
 };
 
+// Mock GPIO directions, which are analogous to actual GPIO directions.
+enum MockGpioDir {
+  kMockGpioDirIn = 0,
+  kMockGpioDirOut,
+  kMockGpioDirMax  // marker, do not remove!
+};
+
+// Mock GPIO values, ditto.
+enum MockGpioVal {
+  kMockGpioValUp = 0,
+  kMockGpioValDown,
+  kMockGpioValMax  // marker, do not remove!
+};
+
 }  // chromeos_update_engine
 
 #endif /* CHROMEOS_PLATFORM_UPDATE_ENGINE_GPIO_HANDLER_UNITTEST_H__ */