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

Side by Side Diff: content/browser/loader/async_revalidation_manager_unittest.cc

Issue 2469673002: Invalidate WeakPtrs of ResourceMessageFilter on channel shutdown (Closed)
Patch Set: rebase 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 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 request_context->set_job_factory(job_factory_.get()); 281 request_context->set_job_factory(job_factory_.get());
282 request_context->set_network_delegate(network_delegate_.get()); 282 request_context->set_network_delegate(network_delegate_.get());
283 host_.EnableStaleWhileRevalidateForTesting(); 283 host_.EnableStaleWhileRevalidateForTesting();
284 } 284 }
285 285
286 AsyncRevalidationManagerTest() 286 AsyncRevalidationManagerTest()
287 : AsyncRevalidationManagerTest( 287 : AsyncRevalidationManagerTest(
288 base::WrapUnique(new net::TestNetworkDelegate)) {} 288 base::WrapUnique(new net::TestNetworkDelegate)) {}
289 289
290 void TearDown() override { 290 void TearDown() override {
291 filter_->OnChannelClosing();
291 host_.CancelRequestsForProcess(filter_->child_id()); 292 host_.CancelRequestsForProcess(filter_->child_id());
292 host_.Shutdown(); 293 host_.Shutdown();
293 host_.CancelRequestsForContext(browser_context_->GetResourceContext()); 294 host_.CancelRequestsForContext(browser_context_->GetResourceContext());
294 browser_context_.reset(); 295 browser_context_.reset();
295 base::RunLoop().RunUntilIdle(); 296 base::RunLoop().RunUntilIdle();
296 } 297 }
297 298
298 void SetResponse(const std::string& headers, const std::string& data) { 299 void SetResponse(const std::string& headers, const std::string& data) {
299 job_factory_->SetResponse(headers, data); 300 job_factory_->SetResponse(headers, data);
300 } 301 }
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 // already completed. 549 // already completed.
549 EXPECT_TRUE(NextRequestWasDestroyed()); 550 EXPECT_TRUE(NextRequestWasDestroyed());
550 551
551 // But no others. 552 // But no others.
552 EXPECT_TRUE(IsEmpty()); 553 EXPECT_TRUE(IsEmpty());
553 } 554 }
554 555
555 } // namespace 556 } // namespace
556 557
557 } // namespace content 558 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698