| Index: http_fetcher_unittest.cc
|
| diff --git a/http_fetcher_unittest.cc b/http_fetcher_unittest.cc
|
| index 87dda7831df45ea36131369d30e8813f803e5c41..7e01c6ca9f253b7a5bb3c53bec5149f81db61161 100644
|
| --- a/http_fetcher_unittest.cc
|
| +++ b/http_fetcher_unittest.cc
|
| @@ -16,6 +16,7 @@
|
| #include "update_engine/libcurl_http_fetcher.h"
|
| #include "update_engine/mock_http_fetcher.h"
|
| #include "update_engine/multi_http_fetcher.h"
|
| +#include "update_engine/proxy_resolver.h"
|
|
|
| using std::make_pair;
|
| using std::string;
|
| @@ -56,10 +57,16 @@ class HttpFetcherTest<MockHttpFetcher> : public ::testing::Test {
|
| public:
|
| HttpFetcher* NewLargeFetcher() {
|
| vector<char> big_data(1000000);
|
| - return new MockHttpFetcher(big_data.data(), big_data.size());
|
| + return new MockHttpFetcher(
|
| + big_data.data(),
|
| + big_data.size(),
|
| + reinterpret_cast<ProxyResolver*>(&proxy_resolver_));
|
| }
|
| HttpFetcher* NewSmallFetcher() {
|
| - return new MockHttpFetcher("x", 1);
|
| + return new MockHttpFetcher(
|
| + "x",
|
| + 1,
|
| + reinterpret_cast<ProxyResolver*>(&proxy_resolver_));
|
| }
|
| string BigUrl() const {
|
| return "unused://unused";
|
| @@ -71,6 +78,8 @@ class HttpFetcherTest<MockHttpFetcher> : public ::testing::Test {
|
| bool IsMulti() const { return false; }
|
| typedef NullHttpServer HttpServer;
|
| void IgnoreServerAborting(HttpServer* server) const {}
|
| +
|
| + DirectProxyResolver proxy_resolver_;
|
| };
|
|
|
| class PythonHttpServer {
|
| @@ -131,7 +140,8 @@ template <>
|
| class HttpFetcherTest<LibcurlHttpFetcher> : public ::testing::Test {
|
| public:
|
| virtual HttpFetcher* NewLargeFetcher() {
|
| - LibcurlHttpFetcher *ret = new LibcurlHttpFetcher;
|
| + LibcurlHttpFetcher *ret = new
|
| + LibcurlHttpFetcher(reinterpret_cast<ProxyResolver*>(&proxy_resolver_));
|
| // Speed up test execution.
|
| ret->set_idle_seconds(1);
|
| ret->set_retry_seconds(1);
|
| @@ -155,6 +165,7 @@ class HttpFetcherTest<LibcurlHttpFetcher> : public ::testing::Test {
|
| PythonHttpServer *pyserver = reinterpret_cast<PythonHttpServer*>(server);
|
| pyserver->validate_quit_ = false;
|
| }
|
| + DirectProxyResolver proxy_resolver_;
|
| };
|
|
|
| template <>
|
| @@ -163,7 +174,8 @@ class HttpFetcherTest<MultiHttpFetcher<LibcurlHttpFetcher> >
|
| public:
|
| HttpFetcher* NewLargeFetcher() {
|
| MultiHttpFetcher<LibcurlHttpFetcher> *ret =
|
| - new MultiHttpFetcher<LibcurlHttpFetcher>;
|
| + new MultiHttpFetcher<LibcurlHttpFetcher>(
|
| + reinterpret_cast<ProxyResolver*>(&proxy_resolver_));
|
| MultiHttpFetcher<LibcurlHttpFetcher>::RangesVect
|
| ranges(1, make_pair(0, -1));
|
| ret->set_ranges(ranges);
|
| @@ -175,6 +187,7 @@ class HttpFetcherTest<MultiHttpFetcher<LibcurlHttpFetcher> >
|
| return ret;
|
| }
|
| bool IsMulti() const { return true; }
|
| + DirectProxyResolver proxy_resolver_;
|
| };
|
|
|
| typedef ::testing::Types<LibcurlHttpFetcher,
|
|
|