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

Unified Diff: net/proxy/proxy_script_fetcher_impl_unittest.cc

Issue 253603004: Make it so net/ can be built without file:// support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: merge Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/net.gyp ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_script_fetcher_impl_unittest.cc
===================================================================
--- net/proxy/proxy_script_fetcher_impl_unittest.cc (revision 268640)
+++ net/proxy/proxy_script_fetcher_impl_unittest.cc (working copy)
@@ -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 @@
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 @@
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 @@
RequestContext context_;
};
+#if !defined(DISABLE_FILE_SUPPORT)
TEST_F(ProxyScriptFetcherImplTest, FileUrl) {
ProxyScriptFetcherImpl pac_fetcher(&context_);
@@ -221,6 +228,7 @@
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.
« no previous file with comments | « net/net.gyp ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698