Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1433)

Unified Diff: http_fetcher_unittest.cc

Issue 5205002: AU: Manual proxy support (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: missed one fix for review Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « http_fetcher.cc ('k') | libcurl_http_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: http_fetcher_unittest.cc
diff --git a/http_fetcher_unittest.cc b/http_fetcher_unittest.cc
index 87dda7831df45ea36131369d30e8813f803e5c41..a42bb3b64e2f4c68dc6fff18913f4ff5408fbb3a 100644
--- a/http_fetcher_unittest.cc
+++ b/http_fetcher_unittest.cc
@@ -8,14 +8,16 @@
#include <utility>
#include <vector>
-#include "base/logging.h"
-#include "base/scoped_ptr.h"
-#include "base/string_util.h"
-#include "glib.h"
-#include "gtest/gtest.h"
+#include <base/logging.h>
+#include <base/scoped_ptr.h>
+#include <base/string_util.h>
+#include <glib.h>
+#include <gtest/gtest.h>
+
#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 +58,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 +79,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 +141,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 +166,7 @@ class HttpFetcherTest<LibcurlHttpFetcher> : public ::testing::Test {
PythonHttpServer *pyserver = reinterpret_cast<PythonHttpServer*>(server);
pyserver->validate_quit_ = false;
}
+ DirectProxyResolver proxy_resolver_;
};
template <>
@@ -163,7 +175,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 +188,7 @@ class HttpFetcherTest<MultiHttpFetcher<LibcurlHttpFetcher> >
return ret;
}
bool IsMulti() const { return true; }
+ DirectProxyResolver proxy_resolver_;
};
typedef ::testing::Types<LibcurlHttpFetcher,
« no previous file with comments | « http_fetcher.cc ('k') | libcurl_http_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698