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

Unified Diff: net/url_request/url_request_test_util.cc

Issue 9368031: Expose a static configuration value for the host to use for URLRequestTestHTTP tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Parameterize ALL the HTTP servers! Created 8 years, 10 months 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
Index: net/url_request/url_request_test_util.cc
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
index c296745969d1bb288c3cde713ac2bf6c9ca97439..206686489245660398dc4c23b37fcd219107c5bd 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -504,3 +504,18 @@ net::NetworkDelegate::AuthRequiredResponse TestNetworkDelegate::OnAuthRequired(
kStageBeforeRedirect; // a delegate can trigger a redirection
return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
+
+namespace {
+char url_request_test_http_host_[256] = "127.0.0.1";
eroman 2012/02/16 02:41:00 First off, please prefix globals with "g_". Secon
erikwright (departed) 2012/02/16 16:04:13 Done.
+} // namespace
+
+void set_url_request_test_http_host(const std::string& host) {
+ strncpy(url_request_test_http_host_,
+ host.c_str(),
+ arraysize(url_request_test_http_host_) - 1);
+ url_request_test_http_host_[arraysize(url_request_test_http_host_) - 1] = 0;
eroman 2012/02/16 02:41:00 nit: If we have a host literal string longer than
erikwright (departed) 2012/02/16 16:04:13 N/A.
+}
+
+char* url_request_test_http_host() {
eroman 2012/02/16 02:41:00 can you return a const char* so caller can't mutat
erikwright (departed) 2012/02/16 16:04:13 Done.
+ return url_request_test_http_host_;
+}

Powered by Google App Engine
This is Rietveld 408576698