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/proxy/proxy_script_fetcher_impl.h" | 5 #include "net/proxy/proxy_script_fetcher_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 network_session.get(), HttpCache::DefaultBackend::InMemory(0))); | 78 network_session.get(), HttpCache::DefaultBackend::InMemory(0))); |
79 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl(); | 79 URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl(); |
80 #if !defined(DISABLE_FILE_SUPPORT) | 80 #if !defined(DISABLE_FILE_SUPPORT) |
81 job_factory->SetProtocolHandler( | 81 job_factory->SetProtocolHandler( |
82 "file", new FileProtocolHandler(base::MessageLoopProxy::current())); | 82 "file", new FileProtocolHandler(base::MessageLoopProxy::current())); |
83 #endif | 83 #endif |
84 storage_.set_job_factory(job_factory); | 84 storage_.set_job_factory(job_factory); |
85 } | 85 } |
86 | 86 |
87 virtual ~RequestContext() { | 87 virtual ~RequestContext() { |
| 88 AssertNoURLRequests(); |
88 } | 89 } |
89 | 90 |
90 private: | 91 private: |
91 URLRequestContextStorage storage_; | 92 URLRequestContextStorage storage_; |
92 }; | 93 }; |
93 | 94 |
94 #if !defined(DISABLE_FILE_SUPPORT) | 95 #if !defined(DISABLE_FILE_SUPPORT) |
95 // Get a file:// url relative to net/data/proxy/proxy_script_fetcher_unittest. | 96 // Get a file:// url relative to net/data/proxy/proxy_script_fetcher_unittest. |
96 GURL GetTestFileUrl(const std::string& relpath) { | 97 GURL GetTestFileUrl(const std::string& relpath) { |
97 base::FilePath path; | 98 base::FilePath path; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 { | 484 { |
484 GURL url(kEncodedUrlBroken); | 485 GURL url(kEncodedUrlBroken); |
485 base::string16 text; | 486 base::string16 text; |
486 TestCompletionCallback callback; | 487 TestCompletionCallback callback; |
487 int result = pac_fetcher.Fetch(url, &text, callback.callback()); | 488 int result = pac_fetcher.Fetch(url, &text, callback.callback()); |
488 EXPECT_EQ(ERR_FAILED, result); | 489 EXPECT_EQ(ERR_FAILED, result); |
489 } | 490 } |
490 } | 491 } |
491 | 492 |
492 } // namespace net | 493 } // namespace net |
OLD | NEW |