OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stack> | 5 #include <stack> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 class MockURLRequestDelegate : public net::URLRequest::Delegate { | 69 class MockURLRequestDelegate : public net::URLRequest::Delegate { |
70 virtual void OnResponseStarted(net::URLRequest* request) {} | 70 virtual void OnResponseStarted(net::URLRequest* request) {} |
71 virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) {} | 71 virtual void OnReadCompleted(net::URLRequest* request, int bytes_read) {} |
72 }; | 72 }; |
73 | 73 |
74 class MockURLRequestJob : public net::URLRequestJob { | 74 class MockURLRequestJob : public net::URLRequestJob { |
75 public: | 75 public: |
76 MockURLRequestJob(net::URLRequest* request, | 76 MockURLRequestJob(net::URLRequest* request, |
77 int response_code) | 77 int response_code) |
78 : net::URLRequestJob(request), | 78 : net::URLRequestJob(request, request->context()->network_delegate()), |
79 response_code_(response_code), | 79 response_code_(response_code), |
80 has_response_info_(false) {} | 80 has_response_info_(false) {} |
81 MockURLRequestJob(net::URLRequest* request, | 81 MockURLRequestJob(net::URLRequest* request, |
82 const net::HttpResponseInfo& info) | 82 const net::HttpResponseInfo& info) |
83 : net::URLRequestJob(request), | 83 : net::URLRequestJob(request, |
| 84 request->context()->network_delegate()), |
84 response_code_(info.headers->response_code()), | 85 response_code_(info.headers->response_code()), |
85 has_response_info_(true), | 86 has_response_info_(true), |
86 response_info_(info) {} | 87 response_info_(info) {} |
87 | 88 |
88 protected: | 89 protected: |
89 virtual ~MockURLRequestJob() {} | 90 virtual ~MockURLRequestJob() {} |
90 virtual void Start() OVERRIDE { | 91 virtual void Start() OVERRIDE { |
91 NotifyHeadersComplete(); | 92 NotifyHeadersComplete(); |
92 } | 93 } |
93 virtual int GetResponseCode() const OVERRIDE { | 94 virtual int GetResponseCode() const OVERRIDE { |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 | 901 |
901 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { | 902 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { |
902 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest); | 903 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest); |
903 } | 904 } |
904 | 905 |
905 TEST_F(AppCacheRequestHandlerTest, MainResource_Blocked) { | 906 TEST_F(AppCacheRequestHandlerTest, MainResource_Blocked) { |
906 RunTestOnIOThread(&AppCacheRequestHandlerTest::MainResource_Blocked); | 907 RunTestOnIOThread(&AppCacheRequestHandlerTest::MainResource_Blocked); |
907 } | 908 } |
908 | 909 |
909 } // namespace appcache | 910 } // namespace appcache |
OLD | NEW |