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

Side by Side Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 686343002: Add MaybeInterceptRedirect/Response to URLRequestInterceptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/fileapi/chrome_blob_storage_context.h" 10 #include "content/browser/fileapi/chrome_blob_storage_context.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 const char kHeaders[] = 201 const char kHeaders[] =
202 "HTTP/1.1 200 OK\0" 202 "HTTP/1.1 200 OK\0"
203 "Content-Type: text/javascript\0" 203 "Content-Type: text/javascript\0"
204 "Expires: Thu, 1 Jan 2100 20:00:00 GMT\0" 204 "Expires: Thu, 1 Jan 2100 20:00:00 GMT\0"
205 "\0"; 205 "\0";
206 std::string headers(kHeaders, arraysize(kHeaders)); 206 std::string headers(kHeaders, arraysize(kHeaders));
207 return new net::URLRequestTestJob( 207 return new net::URLRequestTestJob(
208 request, network_delegate, headers, body_, true); 208 request, network_delegate, headers, body_, true);
209 } 209 }
210 210
211 net::URLRequestJob* MaybeInterceptResponse(
212 net::URLRequest* request,
213 net::NetworkDelegate* network_delegate) const override {
214 return NULL;
215 }
216
217 net::URLRequestJob* MaybeInterceptRedirect(
218 net::URLRequest* request,
219 net::NetworkDelegate* network_delegate,
220 const GURL& location) const override {
221 return NULL;
222 }
223
211 private: 224 private:
212 std::string body_; 225 std::string body_;
213 DISALLOW_COPY_AND_ASSIGN(LongLivedResourceInterceptor); 226 DISALLOW_COPY_AND_ASSIGN(LongLivedResourceInterceptor);
214 }; 227 };
215 228
216 void CreateLongLivedResourceInterceptors( 229 void CreateLongLivedResourceInterceptors(
217 const GURL& worker_url, const GURL& import_url) { 230 const GURL& worker_url, const GURL& import_url) {
218 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 231 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
219 scoped_ptr<net::URLRequestInterceptor> interceptor; 232 scoped_ptr<net::URLRequestInterceptor> interceptor;
220 233
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 RunOnIOThread( 951 RunOnIOThread(
939 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, 952 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO,
940 this, 953 this,
941 embedded_test_server()->GetURL("/service_worker/empty.html"), 954 embedded_test_server()->GetURL("/service_worker/empty.html"),
942 &status)); 955 &status));
943 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); 956 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status);
944 } 957 }
945 } 958 }
946 959
947 } // namespace content 960 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698