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

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

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 | « net/test/embedded_test_server/embedded_test_server.h ('k') | no next file » | 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.cc
diff --git a/net/test/embedded_test_server/embedded_test_server.cc b/net/test/embedded_test_server/embedded_test_server.cc
index 59714e33d4042f8aa5de4ae9f759aacfee97aee3..c93ff0c7f8c6449e6ac23f0f8cd5961a34a34ac5 100644
--- a/net/test/embedded_test_server/embedded_test_server.cc
+++ b/net/test/embedded_test_server/embedded_test_server.cc
@@ -170,6 +170,9 @@ void EmbeddedTestServer::HandleRequest(HttpConnection* connection,
std::unique_ptr<HttpRequest> request) {
DCHECK(io_thread_->task_runner()->BelongsToCurrentThread());
+ for (const auto& monitor : request_monitors_)
+ monitor.Run(*request);
+
std::unique_ptr<HttpResponse> response;
for (const auto& handler : request_handlers_) {
@@ -284,15 +287,22 @@ void EmbeddedTestServer::AddDefaultHandlers(const base::FilePath& directory) {
void EmbeddedTestServer::RegisterRequestHandler(
const HandleRequestCallback& callback) {
- // TODO(svaldez): Add check to prevent RegisterHandler from being called
- // after the server has started. https://crbug.com/546060
+ // TODO(svaldez): Add check to prevent RegisterRequestHandler from being
+ // called after the server has started. https://crbug.com/546060
request_handlers_.push_back(callback);
}
+void EmbeddedTestServer::RegisterRequestMonitor(
+ const MonitorRequestCallback& callback) {
+ // TODO(svaldez): Add check to prevent RegisterRequestMonitor from being
+ // called after the server has started. https://crbug.com/546060
+ request_monitors_.push_back(callback);
+}
+
void EmbeddedTestServer::RegisterDefaultHandler(
const HandleRequestCallback& callback) {
- // TODO(svaldez): Add check to prevent RegisterHandler from being called
- // after the server has started. https://crbug.com/546060
+ // TODO(svaldez): Add check to prevent RegisterDefaultHandler from being
+ // called after the server has started. https://crbug.com/546060
default_request_handlers_.push_back(callback);
}
« no previous file with comments | « net/test/embedded_test_server/embedded_test_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698