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

Side by Side Diff: net/proxy/proxy_script_fetcher_unittest.cc

Issue 3019007: Add a command line flag to change the default number of parallel DNS requests... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address jar's comments Created 10 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/host_resolver_impl.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/proxy/proxy_script_fetcher.h" 5 #include "net/proxy/proxy_script_fetcher.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 14 matching lines...) Expand all
25 struct FetchResult { 25 struct FetchResult {
26 int code; 26 int code;
27 string16 text; 27 string16 text;
28 }; 28 };
29 29
30 // A non-mock URL request which can access http:// and file:// urls. 30 // A non-mock URL request which can access http:// and file:// urls.
31 class RequestContext : public URLRequestContext { 31 class RequestContext : public URLRequestContext {
32 public: 32 public:
33 RequestContext() { 33 RequestContext() {
34 net::ProxyConfig no_proxy; 34 net::ProxyConfig no_proxy;
35 host_resolver_ = net::CreateSystemHostResolver(); 35 host_resolver_ =
36 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism);
36 proxy_service_ = net::ProxyService::CreateFixed(no_proxy); 37 proxy_service_ = net::ProxyService::CreateFixed(no_proxy);
37 ssl_config_service_ = new net::SSLConfigServiceDefaults; 38 ssl_config_service_ = new net::SSLConfigServiceDefaults;
38 39
39 http_transaction_factory_ = new net::HttpCache( 40 http_transaction_factory_ = new net::HttpCache(
40 net::HttpNetworkLayer::CreateFactory(host_resolver_, proxy_service_, 41 net::HttpNetworkLayer::CreateFactory(host_resolver_, proxy_service_,
41 ssl_config_service_, NULL, NULL, NULL), 42 ssl_config_service_, NULL, NULL, NULL),
42 net::HttpCache::DefaultBackend::InMemory(0)); 43 net::HttpCache::DefaultBackend::InMemory(0));
43 } 44 }
44 45
45 private: 46 private:
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 string16 text; 320 string16 text;
320 TestCompletionCallback callback; 321 TestCompletionCallback callback;
321 int result = pac_fetcher->Fetch(url, &text, &callback); 322 int result = pac_fetcher->Fetch(url, &text, &callback);
322 EXPECT_EQ(ERR_IO_PENDING, result); 323 EXPECT_EQ(ERR_IO_PENDING, result);
323 EXPECT_EQ(OK, callback.WaitForResult()); 324 EXPECT_EQ(OK, callback.WaitForResult());
324 EXPECT_EQ(ASCIIToUTF16("This was encoded as UTF-16BE.\n"), text); 325 EXPECT_EQ(ASCIIToUTF16("This was encoded as UTF-16BE.\n"), text);
325 } 326 }
326 } 327 }
327 328
328 } // namespace net 329 } // namespace net
OLDNEW
« no previous file with comments | « net/base/host_resolver_impl.cc ('k') | net/socket/ssl_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698