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

Unified Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 2535723005: Stop using ResourceController in ResourceThrottle (Closed)
Patch Set: Addressed #62 Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/resource_dispatcher_host_unittest.cc
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index 734144f59f7f2059c19948713c1b5344d2c0a085..b53228912f98e72c705dc5776c2054a6f15ca4cb 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -672,9 +672,9 @@ class GenericResourceThrottle : public ResourceThrottle {
if (flags_ & CANCEL_BEFORE_START) {
if (error_code_for_cancellation_ == USE_DEFAULT_CANCEL_ERROR_CODE) {
- controller()->Cancel();
+ Cancel();
} else {
- controller()->CancelWithError(error_code_for_cancellation_);
+ CancelWithError(error_code_for_cancellation_);
}
}
}
@@ -688,9 +688,9 @@ class GenericResourceThrottle : public ResourceThrottle {
if (flags_ & CANCEL_PROCESSING_RESPONSE) {
if (error_code_for_cancellation_ == USE_DEFAULT_CANCEL_ERROR_CODE) {
- controller()->Cancel();
+ Cancel();
} else {
- controller()->CancelWithError(error_code_for_cancellation_);
+ CancelWithError(error_code_for_cancellation_);
}
}
}
@@ -699,10 +699,10 @@ class GenericResourceThrottle : public ResourceThrottle {
return "GenericResourceThrottle";
}
- void Resume() {
+ void AssertAndResume() {
ASSERT_TRUE(this == active_throttle_);
active_throttle_ = NULL;
- controller()->Resume();
+ ResourceThrottle::Resume();
}
static GenericResourceThrottle* active_throttle() {
@@ -1779,7 +1779,7 @@ TEST_P(ResourceDispatcherHostTest, DetachWhileStartIsDeferred) {
GenericResourceThrottle* throttle =
GenericResourceThrottle::active_throttle();
ASSERT_TRUE(throttle);
- throttle->Resume();
+ throttle->AssertAndResume();
// Now, the request completes.
while (net::URLRequestTestJob::ProcessOnePendingMessage()) {}
@@ -1843,12 +1843,12 @@ TEST_P(ResourceDispatcherHostTest, ThrottleAndResumeTwice) {
GenericResourceThrottle* first_throttle =
GenericResourceThrottle::active_throttle();
ASSERT_TRUE(first_throttle);
- first_throttle->Resume();
+ first_throttle->AssertAndResume();
// Make sure the second throttle blocked the request, and then resume.
ASSERT_TRUE(GenericResourceThrottle::active_throttle());
ASSERT_NE(first_throttle, GenericResourceThrottle::active_throttle());
- GenericResourceThrottle::active_throttle()->Resume();
+ GenericResourceThrottle::active_throttle()->AssertAndResume();
ASSERT_FALSE(GenericResourceThrottle::active_throttle());
« no previous file with comments | « content/browser/loader/navigation_resource_throttle.cc ('k') | content/browser/loader/resource_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698