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

Side by Side Diff: content/browser/appcache/appcache_request_handler_unittest.cc

Issue 2501343003: PlzNavigate: AppCache support. (Closed)
Patch Set: Add DCHECKs for PlzNavigate and fix a double Release problem which caused one unit_test to fail wit… Created 4 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 "content/browser/appcache/appcache_request_handler.h" 5 #include "content/browser/appcache/appcache_request_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <stack> 9 #include <stack>
10 #include <string> 10 #include <string>
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 void SetUpTest() { 215 void SetUpTest() {
216 DCHECK(io_thread_->task_runner()->BelongsToCurrentThread()); 216 DCHECK(io_thread_->task_runner()->BelongsToCurrentThread());
217 mock_service_.reset(new MockAppCacheService); 217 mock_service_.reset(new MockAppCacheService);
218 mock_service_->set_request_context(&empty_context_); 218 mock_service_->set_request_context(&empty_context_);
219 mock_policy_.reset(new MockAppCachePolicy); 219 mock_policy_.reset(new MockAppCachePolicy);
220 mock_service_->set_appcache_policy(mock_policy_.get()); 220 mock_service_->set_appcache_policy(mock_policy_.get());
221 mock_frontend_.reset(new MockFrontend); 221 mock_frontend_.reset(new MockFrontend);
222 backend_impl_.reset(new AppCacheBackendImpl); 222 backend_impl_.reset(new AppCacheBackendImpl);
223 backend_impl_->Initialize(mock_service_.get(), mock_frontend_.get(), 223 backend_impl_->Initialize(mock_service_.get(), mock_frontend_.get(),
224 kMockProcessId); 224 kMockProcessId, -1);
225 const int kHostId = 1; 225 const int kHostId = 1;
226 backend_impl_->RegisterHost(kHostId); 226 backend_impl_->RegisterHost(kHostId);
227 host_ = backend_impl_->GetHost(kHostId); 227 host_ = backend_impl_->GetHost(kHostId);
228 job_factory_.reset(new MockURLRequestJobFactory()); 228 job_factory_.reset(new MockURLRequestJobFactory());
229 empty_context_.set_job_factory(job_factory_.get()); 229 empty_context_.set_job_factory(job_factory_.get());
230 } 230 }
231 231
232 void TearDownTest() { 232 void TearDownTest() {
233 DCHECK(io_thread_->task_runner()->BelongsToCurrentThread()); 233 DCHECK(io_thread_->task_runner()->BelongsToCurrentThread());
234 job_ = NULL; 234 job_ = NULL;
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 1123
1124 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) { 1124 TEST_F(AppCacheRequestHandlerTest, WorkerRequest) {
1125 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest); 1125 RunTestOnIOThread(&AppCacheRequestHandlerTest::WorkerRequest);
1126 } 1126 }
1127 1127
1128 TEST_F(AppCacheRequestHandlerTest, MainResource_Blocked) { 1128 TEST_F(AppCacheRequestHandlerTest, MainResource_Blocked) {
1129 RunTestOnIOThread(&AppCacheRequestHandlerTest::MainResource_Blocked); 1129 RunTestOnIOThread(&AppCacheRequestHandlerTest::MainResource_Blocked);
1130 } 1130 }
1131 1131
1132 } // namespace content 1132 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698