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

Unified Diff: net/url_request/url_request_test_util.h

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: Make overrides stackable, and other review comments. 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
« no previous file with comments | « no previous file | net/url_request/url_request_test_util.cc » ('j') | net/url_request/url_request_test_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_test_util.h
diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h
index d6054c01d0d0b65ad6ac9155a3185a7eef61a6b2..29ecb983080e6d354c3a21b5864bc2d5330c72ab 100644
--- a/net/url_request/url_request_test_util.h
+++ b/net/url_request/url_request_test_util.h
@@ -11,6 +11,7 @@
#include <map>
#include <string>
+#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/path_service.h"
#include "base/process_util.h"
@@ -242,4 +243,29 @@ class TestNetworkDelegate : public net::NetworkDelegate {
std::map<int, std::string> event_order_;
};
+// Overrides the host used by the LocalHttpTestServer in
+// url_request_unittest.cc . This is used by the chrome_frame_net_tests due to
+// a mysterious bug when tests execute over the loopback adapter. See
+// http://crbug.com/114369 .
+class ScopedCustomUrlRequestTestHttpHost {
+ public:
+ // Sets the host name to be used. The previous hostname will be stored and
+ // restored upon destruction. Note that if the lifetimes of two or more
+ // instances of this class overlap, they must be strictly nested.
+ explicit ScopedCustomUrlRequestTestHttpHost(const std::string& new_value);
+
+ ~ScopedCustomUrlRequestTestHttpHost();
+
+ // Returns the current value to be used by HTTP tests in
+ // url_request_unittest.cc .
+ static const std::string& value();
+
+ private:
+ static std::string value_;
+ const std::string old_value_;
+ const std::string new_value_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost);
+};
+
#endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
« no previous file with comments | « no previous file | net/url_request/url_request_test_util.cc » ('j') | net/url_request/url_request_test_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698