OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/url_request/url_request_context_builder.h" | 5 #include "net/url_request/url_request_context_builder.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "net/test/test_server.h" | 8 #include "net/test/test_server.h" |
9 #include "net/url_request/url_request.h" | 9 #include "net/url_request/url_request.h" |
10 #include "net/url_request/url_request_test_util.h" | 10 #include "net/url_request/url_request_test_util.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace { | 21 namespace { |
22 | 22 |
23 // A subclass of TestServer that uses a statically-configured hostname. This is | 23 // A subclass of TestServer that uses a statically-configured hostname. This is |
24 // to work around mysterious failures in chrome_frame_net_tests. See: | 24 // to work around mysterious failures in chrome_frame_net_tests. See: |
25 // http://crbug.com/114369 | 25 // http://crbug.com/114369 |
26 class LocalHttpTestServer : public TestServer { | 26 class LocalHttpTestServer : public TestServer { |
27 public: | 27 public: |
28 explicit LocalHttpTestServer(const base::FilePath& document_root) | 28 explicit LocalHttpTestServer(const base::FilePath& document_root) |
29 : TestServer(TestServer::TYPE_HTTP, | 29 : TestServer(TestServer::TYPE_HTTP, |
30 ScopedCustomUrlRequestTestHttpHost::value(), | 30 ScopedCustomUrlRequestTestHttpHost::value(), |
31 document_root) {} | 31 GetSourceRelativePath(document_root)) {} |
32 LocalHttpTestServer() | |
33 : TestServer(TestServer::TYPE_HTTP, | |
34 ScopedCustomUrlRequestTestHttpHost::value(), | |
35 base::FilePath()) {} | |
36 }; | 32 }; |
37 | 33 |
38 class URLRequestContextBuilderTest : public PlatformTest { | 34 class URLRequestContextBuilderTest : public PlatformTest { |
39 protected: | 35 protected: |
40 URLRequestContextBuilderTest() | 36 URLRequestContextBuilderTest() |
41 : test_server_( | 37 : test_server_( |
42 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))) { | 38 base::FilePath(FILE_PATH_LITERAL("net/data/url_request_unittest"))) { |
43 #if defined(OS_LINUX) || defined(OS_ANDROID) | 39 #if defined(OS_LINUX) || defined(OS_ANDROID) |
44 builder_.set_proxy_config_service( | 40 builder_.set_proxy_config_service( |
45 new ProxyConfigServiceFixed(ProxyConfig::CreateDirect())); | 41 new ProxyConfigServiceFixed(ProxyConfig::CreateDirect())); |
(...skipping 28 matching lines...) Expand all Loading... |
74 test_server_.GetURL("echoheader?User-Agent"), &delegate, context.get()); | 70 test_server_.GetURL("echoheader?User-Agent"), &delegate, context.get()); |
75 request.set_method("GET"); | 71 request.set_method("GET"); |
76 request.Start(); | 72 request.Start(); |
77 MessageLoop::current()->Run(); | 73 MessageLoop::current()->Run(); |
78 EXPECT_EQ("Bar", delegate.data_received()); | 74 EXPECT_EQ("Bar", delegate.data_received()); |
79 } | 75 } |
80 | 76 |
81 } // namespace | 77 } // namespace |
82 | 78 |
83 } // namespace net | 79 } // namespace net |
OLD | NEW |