Enable test mode updates.

* Uses the GPIO module to deduce whether a current update session needs
  to be treated as a controlled test, which allows a few relaxations.

* LibcurlHttpFetcher is extended to relax some of its security lock down
  provisions.

* Fix: a test mode flag remains persistent throughout an update attempt,
  so that it can be delegated to the various HttpFetcher instances used
  in the same attempt.

BUG=chromium-os:25397
TEST=Builds and unittests; automated test script works w/ servo
connected Alex

Change-Id: I8a29d1a21a0632912c10f01f69a26d9c659472fd
Reviewed-on: https://gerrit.chromium.org/gerrit/25128
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
diff --git a/libcurl_http_fetcher.h b/libcurl_http_fetcher.h
index e317819..981d096 100644
--- a/libcurl_http_fetcher.h
+++ b/libcurl_http_fetcher.h
@@ -31,7 +31,8 @@
   static const int kMaxRetryCountOobeNotComplete;
 
   LibcurlHttpFetcher(ProxyResolver* proxy_resolver,
-                     SystemState* system_state)
+                     SystemState* system_state,
+                     bool is_test_mode)
       : HttpFetcher(proxy_resolver, system_state),
         curl_multi_handle_(NULL),
         curl_handle_(NULL),
@@ -53,7 +54,8 @@
         in_write_callback_(false),
         sent_byte_(false),
         terminate_requested_(false),
-        check_certificate_(CertificateChecker::kNone) {}
+        check_certificate_(CertificateChecker::kNone),
+        is_test_mode_(is_test_mode) {}
 
   // Cleans up all internal state. Does not notify delegate
   ~LibcurlHttpFetcher();
@@ -258,6 +260,9 @@
   // this should be kNone.
   CertificateChecker::ServerToCheck check_certificate_;
 
+  // If true, utilizes a relaxed test mode fetch logic. False by default.
+  bool is_test_mode_;
+
   DISALLOW_COPY_AND_ASSIGN(LibcurlHttpFetcher);
 };