| OLD | NEW |
| 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 Loading... |
| 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* MaybeInterceptRedirect( |
| 212 net::URLRequest* request, |
| 213 net::NetworkDelegate* network_delegate, |
| 214 const GURL& location) const override { |
| 215 return NULL; |
| 216 } |
| 217 |
| 218 net::URLRequestJob* MaybeInterceptResponse( |
| 219 net::URLRequest* request, |
| 220 net::NetworkDelegate* network_delegate) 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 RunOnIOThread( | 954 RunOnIOThread( |
| 942 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, | 955 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, |
| 943 this, | 956 this, |
| 944 embedded_test_server()->GetURL("/service_worker/empty.html"), | 957 embedded_test_server()->GetURL("/service_worker/empty.html"), |
| 945 &status)); | 958 &status)); |
| 946 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); | 959 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); |
| 947 } | 960 } |
| 948 } | 961 } |
| 949 | 962 |
| 950 } // namespace content | 963 } // namespace content |
| OLD | NEW |