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.cc b/libcurl_http_fetcher.cc
index 6153f4c..7c40cba 100644
--- a/libcurl_http_fetcher.cc
+++ b/libcurl_http_fetcher.cc
@@ -171,7 +171,7 @@
   // Security lock-down in official builds: makes sure that peer certificate
   // verification is enabled, restricts the set of trusted certificates,
   // restricts protocols to HTTPS, restricts ciphers to HIGH.
-  if (IsOfficialBuild()) {
+  if (!is_test_mode_ && IsOfficialBuild()) {
     CHECK_EQ(curl_easy_setopt(curl_handle_, CURLOPT_SSL_VERIFYPEER, 1),
              CURLE_OK);
     CHECK_EQ(curl_easy_setopt(curl_handle_,