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

Side by Side Diff: webkit/appcache/appcache_url_request_job_unittest.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <utility> 6 #include <utility>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 }; 128 };
129 129
130 static net::URLRequestJob* MockHttpJobFactory(net::URLRequest* request, 130 static net::URLRequestJob* MockHttpJobFactory(net::URLRequest* request,
131 const std::string& scheme) { 131 const std::string& scheme) {
132 if (mock_factory_job_) { 132 if (mock_factory_job_) {
133 net::URLRequestJob* temp = mock_factory_job_; 133 net::URLRequestJob* temp = mock_factory_job_;
134 mock_factory_job_ = NULL; 134 mock_factory_job_ = NULL;
135 return temp; 135 return temp;
136 } else { 136 } else {
137 return new net::URLRequestErrorJob(request, 137 return new net::URLRequestErrorJob(request,
138 request->context()->network_delegate(),
138 net::ERR_INTERNET_DISCONNECTED); 139 net::ERR_INTERNET_DISCONNECTED);
139 } 140 }
140 } 141 }
141 142
142 // Helper callback to run a test on our io_thread. The io_thread is spun up 143 // Helper callback to run a test on our io_thread. The io_thread is spun up
143 // once and reused for all tests. 144 // once and reused for all tests.
144 template <class Method> 145 template <class Method>
145 void MethodWrapper(Method method) { 146 void MethodWrapper(Method method) {
146 SetUpTest(); 147 SetUpTest();
147 (this->*method)(); 148 (this->*method)();
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 799
799 TEST_F(AppCacheURLRequestJobTest, CancelRequest) { 800 TEST_F(AppCacheURLRequestJobTest, CancelRequest) {
800 RunTestOnIOThread(&AppCacheURLRequestJobTest::CancelRequest); 801 RunTestOnIOThread(&AppCacheURLRequestJobTest::CancelRequest);
801 } 802 }
802 803
803 TEST_F(AppCacheURLRequestJobTest, CancelRequestWithIOPending) { 804 TEST_F(AppCacheURLRequestJobTest, CancelRequestWithIOPending) {
804 RunTestOnIOThread(&AppCacheURLRequestJobTest::CancelRequestWithIOPending); 805 RunTestOnIOThread(&AppCacheURLRequestJobTest::CancelRequestWithIOPending);
805 } 806 }
806 807
807 } // namespace appcache 808 } // namespace appcache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698