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

Unified Diff: net/test/embedded_test_server/embedded_test_server.h

Issue 1905873002: Add content_browsertests for testing cache control flags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove ResourceFetcher change temporarily, fix a nit of #19 Created 4 years, 7 months 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
« no previous file with comments | « content/test/data/loader/reload.html ('k') | net/test/embedded_test_server/embedded_test_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/embedded_test_server/embedded_test_server.h
diff --git a/net/test/embedded_test_server/embedded_test_server.h b/net/test/embedded_test_server/embedded_test_server.h
index e3065c0f56ae6c8d36e002ea77187323149ddbe7..3b9e253b9068386eaf19af48ade73f97c1226250 100644
--- a/net/test/embedded_test_server/embedded_test_server.h
+++ b/net/test/embedded_test_server/embedded_test_server.h
@@ -117,6 +117,8 @@ class EmbeddedTestServer {
typedef base::Callback<std::unique_ptr<HttpResponse>(
const HttpRequest& request)>
HandleRequestCallback;
+ typedef base::Callback<void(const HttpRequest& request)>
+ MonitorRequestCallback;
// Creates a http test server. Start() must be called to start the server.
// |type| indicates the protocol type of the server (HTTP/HTTPS).
@@ -207,6 +209,11 @@ class EmbeddedTestServer {
// on UI thread.
void RegisterRequestHandler(const HandleRequestCallback& callback);
+ // Adds request monitors. The |callback| is called before any handlers are
+ // called, but can not respond it. This is useful to monitor requests that
+ // will be handled by other request handlers.
+ void RegisterRequestMonitor(const MonitorRequestCallback& callback);
+
// Adds default handlers, including those added by AddDefaultHandlers, to be
// tried after all other user-specified handlers have been tried.
void RegisterDefaultHandler(const HandleRequestCallback& callback);
@@ -274,8 +281,9 @@ class EmbeddedTestServer {
// Owns the HttpConnection objects.
std::map<StreamSocket*, HttpConnection*> connections_;
- // Vector of registered and default request handlers.
+ // Vector of registered and default request handlers and monitors.
std::vector<HandleRequestCallback> request_handlers_;
+ std::vector<MonitorRequestCallback> request_monitors_;
std::vector<HandleRequestCallback> default_request_handlers_;
base::ThreadChecker thread_checker_;
« no previous file with comments | « content/test/data/loader/reload.html ('k') | net/test/embedded_test_server/embedded_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698