summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authormmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 15:05:29 +0000
committermmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 15:05:29 +0000
commit02494ec2e31ee6f69898e560ab3f7812fbbda1cc (patch)
treef5e13d18320e36ac769dc861b82767bc206ef59e /net/proxy
parent182561f042ab34e010e498299b1e6354bc0a44e9 (diff)
downloadchromium_src-02494ec2e31ee6f69898e560ab3f7812fbbda1cc.zip
chromium_src-02494ec2e31ee6f69898e560ab3f7812fbbda1cc.tar.gz
chromium_src-02494ec2e31ee6f69898e560ab3f7812fbbda1cc.tar.bz2
Make it so net/ can be built without file:// support.
This is a step towards making it possible to build net/ without ICU. ICU is used by directory_lister.cc, which is used for creating file directory listings. BUG=362608 R=mef@chromium.org Review URL: https://codereview.chromium.org/253603004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_script_fetcher_impl_unittest.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index 53f7655..b902850 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -22,7 +22,6 @@
#include "net/http/transport_security_state.h"
#include "net/ssl/ssl_config_service_defaults.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
-#include "net/url_request/file_protocol_handler.h"
#include "net/url_request/url_request_context_storage.h"
#include "net/url_request/url_request_file_job.h"
#include "net/url_request/url_request_job_factory_impl.h"
@@ -30,6 +29,10 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+#if !defined(DISABLE_FILE_SUPPORT)
+#include "net/url_request/file_protocol_handler.h"
+#endif
+
using base::ASCIIToUTF16;
namespace net {
@@ -48,7 +51,8 @@ struct FetchResult {
base::string16 text;
};
-// A non-mock URL request which can access http:// and file:// urls.
+// A non-mock URL request which can access http:// and file:// urls, in the case
+// the tests were built with file support.
class RequestContext : public URLRequestContext {
public:
RequestContext() : storage_(this) {
@@ -73,8 +77,10 @@ class RequestContext : public URLRequestContext {
storage_.set_http_transaction_factory(new HttpCache(
network_session.get(), HttpCache::DefaultBackend::InMemory(0)));
URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl();
+#if !defined(DISABLE_FILE_SUPPORT)
job_factory->SetProtocolHandler(
"file", new FileProtocolHandler(base::MessageLoopProxy::current()));
+#endif
storage_.set_job_factory(job_factory);
}
@@ -199,6 +205,7 @@ class ProxyScriptFetcherImplTest : public PlatformTest {
RequestContext context_;
};
+#if !defined(DISABLE_FILE_SUPPORT)
TEST_F(ProxyScriptFetcherImplTest, FileUrl) {
ProxyScriptFetcherImpl pac_fetcher(&context_);
@@ -221,6 +228,7 @@ TEST_F(ProxyScriptFetcherImplTest, FileUrl) {
EXPECT_EQ(ASCIIToUTF16("-pac.txt-\n"), text);
}
}
+#endif // !defined(DISABLE_FILE_SUPPORT)
// Note that all mime types are allowed for PAC file, to be consistent
// with other browsers.