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

Unified Diff: content/browser/loader/test_resource_handler.h

Issue 2552463002: Add more ResourceLoaderTests (Closed)
Patch Set: Merge 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/test_resource_handler.h
diff --git a/content/browser/loader/test_resource_handler.h b/content/browser/loader/test_resource_handler.h
index 08b172eb1e41d35cc99e562abe56ddf38a7feeb8..cadbbf06d672670d10d1df49f3ae43687c0ef35d 100644
--- a/content/browser/loader/test_resource_handler.h
+++ b/content/browser/loader/test_resource_handler.h
@@ -146,6 +146,9 @@ class TestResourceHandler : public ResourceHandler {
const std::string& body() const { return body_; }
net::URLRequestStatus final_status() const { return final_status_; }
+ // Returns the current number of |this|'s methods on the callstack.
+ int call_depth() const { return call_depth_; }
+
// Spins the message loop until the request is deferred. Using this is
// optional, but if used, must use it exclusively to wait for the request. If
// the request was deferred and then resumed/canceled without calling this
@@ -198,6 +201,9 @@ class TestResourceHandler : public ResourceHandler {
net::URLRequestStatus::FromError(net::ERR_UNEXPECTED);
bool canceled_ = false;
+ // Tracks recursive calls, which aren't allowed.
+ int call_depth_ = 0;
+
std::unique_ptr<base::RunLoop> deferred_run_loop_;
base::RunLoop response_complete_run_loop_;

Powered by Google App Engine
This is Rietveld 408576698