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

Unified Diff: content/browser/appcache/appcache_storage_impl_unittest.cc

Issue 625433002: Pages controlled by ServiceWorkers should not participate in AppCaching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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
Index: content/browser/appcache/appcache_storage_impl_unittest.cc
diff --git a/content/browser/appcache/appcache_storage_impl_unittest.cc b/content/browser/appcache/appcache_storage_impl_unittest.cc
index 69e45efe4151faa88e9580966c4d257d40f6fda9..adfbea74611d24c35985fb3ef5d28246205ce76e 100644
--- a/content/browser/appcache/appcache_storage_impl_unittest.cc
+++ b/content/browser/appcache/appcache_storage_impl_unittest.cc
@@ -126,11 +126,23 @@ class MockHttpServer {
class MockHttpServerJobFactory
: public net::URLRequestJobFactory::ProtocolHandler {
public:
+ MockHttpServerJobFactory(
+ scoped_ptr<net::URLRequestInterceptor> appcache_start_interceptor)
+ : appcache_start_interceptor_(appcache_start_interceptor.Pass()) {
+ }
+
virtual net::URLRequestJob* MaybeCreateJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const override {
+ net::URLRequestJob* appcache_job =
+ appcache_start_interceptor_->MaybeInterceptRequest(
+ request, network_delegate);
+ if (appcache_job)
+ return appcache_job;
return MockHttpServer::CreateJob(request, network_delegate);
}
+ private:
+ scoped_ptr<net::URLRequestInterceptor> appcache_start_interceptor_;
};
class IOThread : public base::Thread {
@@ -150,7 +162,10 @@ class IOThread : public base::Thread {
virtual void Init() override {
scoped_ptr<net::URLRequestJobFactoryImpl> factory(
new net::URLRequestJobFactoryImpl());
- factory->SetProtocolHandler("http", new MockHttpServerJobFactory);
+ factory->SetProtocolHandler(
+ "http",
+ new MockHttpServerJobFactory(
+ AppCacheInterceptor::CreateStartInterceptor()));
job_factory_ = factory.Pass();
request_context_.reset(new net::TestURLRequestContext());
request_context_->set_job_factory(job_factory_.get());
« no previous file with comments | « content/browser/appcache/appcache_request_handler.cc ('k') | content/browser/service_worker/service_worker_provider_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698