| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/loader/async_revalidation_manager.h" | 5 #include "content/browser/loader/async_revalidation_manager.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 request_context->set_job_factory(job_factory_.get()); | 282 request_context->set_job_factory(job_factory_.get()); |
| 283 request_context->set_network_delegate(network_delegate_.get()); | 283 request_context->set_network_delegate(network_delegate_.get()); |
| 284 host_.EnableStaleWhileRevalidateForTesting(); | 284 host_.EnableStaleWhileRevalidateForTesting(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 AsyncRevalidationManagerTest() | 287 AsyncRevalidationManagerTest() |
| 288 : AsyncRevalidationManagerTest( | 288 : AsyncRevalidationManagerTest( |
| 289 base::WrapUnique(new net::TestNetworkDelegate)) {} | 289 base::WrapUnique(new net::TestNetworkDelegate)) {} |
| 290 | 290 |
| 291 void TearDown() override { | 291 void TearDown() override { |
| 292 filter_->OnChannelClosing(); |
| 292 host_.CancelRequestsForProcess(filter_->child_id()); | 293 host_.CancelRequestsForProcess(filter_->child_id()); |
| 293 host_.Shutdown(); | 294 host_.Shutdown(); |
| 294 host_.CancelRequestsForContext(browser_context_->GetResourceContext()); | 295 host_.CancelRequestsForContext(browser_context_->GetResourceContext()); |
| 295 browser_context_.reset(); | 296 browser_context_.reset(); |
| 296 base::RunLoop().RunUntilIdle(); | 297 base::RunLoop().RunUntilIdle(); |
| 297 } | 298 } |
| 298 | 299 |
| 299 void SetResponse(const std::string& headers, const std::string& data) { | 300 void SetResponse(const std::string& headers, const std::string& data) { |
| 300 job_factory_->SetResponse(headers, data); | 301 job_factory_->SetResponse(headers, data); |
| 301 } | 302 } |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 // already completed. | 550 // already completed. |
| 550 EXPECT_TRUE(NextRequestWasDestroyed()); | 551 EXPECT_TRUE(NextRequestWasDestroyed()); |
| 551 | 552 |
| 552 // But no others. | 553 // But no others. |
| 553 EXPECT_TRUE(IsEmpty()); | 554 EXPECT_TRUE(IsEmpty()); |
| 554 } | 555 } |
| 555 | 556 |
| 556 } // namespace | 557 } // namespace |
| 557 | 558 |
| 558 } // namespace content | 559 } // namespace content |
| OLD | NEW |