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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "net/base/request_priority.h" | 9 #include "net/base/request_priority.h" |
10 #include "net/http/http_auth_handler.h" | 10 #include "net/http/http_auth_handler.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 }; | 46 }; |
47 | 47 |
48 class URLRequestContextBuilderTest : public PlatformTest { | 48 class URLRequestContextBuilderTest : public PlatformTest { |
49 protected: | 49 protected: |
50 URLRequestContextBuilderTest() | 50 URLRequestContextBuilderTest() |
51 : test_server_(SpawnedTestServer::TYPE_HTTP, | 51 : test_server_(SpawnedTestServer::TYPE_HTTP, |
52 SpawnedTestServer::kLocalhost, | 52 SpawnedTestServer::kLocalhost, |
53 base::FilePath( | 53 base::FilePath( |
54 FILE_PATH_LITERAL("net/data/url_request_unittest"))) { | 54 FILE_PATH_LITERAL("net/data/url_request_unittest"))) { |
55 #if defined(OS_LINUX) || defined(OS_ANDROID) | 55 #if defined(OS_LINUX) || defined(OS_ANDROID) |
56 builder_.set_proxy_config_service( | 56 builder_.set_proxy_config_service(make_scoped_ptr( |
57 new ProxyConfigServiceFixed(ProxyConfig::CreateDirect())); | 57 new ProxyConfigServiceFixed(ProxyConfig::CreateDirect()))); |
58 #endif // defined(OS_LINUX) || defined(OS_ANDROID) | 58 #endif // defined(OS_LINUX) || defined(OS_ANDROID) |
59 } | 59 } |
60 | 60 |
61 SpawnedTestServer test_server_; | 61 SpawnedTestServer test_server_; |
62 URLRequestContextBuilder builder_; | 62 URLRequestContextBuilder builder_; |
63 }; | 63 }; |
64 | 64 |
65 TEST_F(URLRequestContextBuilderTest, DefaultSettings) { | 65 TEST_F(URLRequestContextBuilderTest, DefaultSettings) { |
66 ASSERT_TRUE(test_server_.Start()); | 66 ASSERT_TRUE(test_server_.Start()); |
67 | 67 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 &handler)); | 109 &handler)); |
110 // Verify that a handler isn't returned for a bogus scheme. | 110 // Verify that a handler isn't returned for a bogus scheme. |
111 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, | 111 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, |
112 context->http_auth_handler_factory()->CreateAuthHandlerFromString( | 112 context->http_auth_handler_factory()->CreateAuthHandlerFromString( |
113 "Bogus", HttpAuth::AUTH_SERVER, gurl, BoundNetLog(), &handler)); | 113 "Bogus", HttpAuth::AUTH_SERVER, gurl, BoundNetLog(), &handler)); |
114 } | 114 } |
115 | 115 |
116 } // namespace | 116 } // namespace |
117 | 117 |
118 } // namespace net | 118 } // namespace net |
OLD | NEW |