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

Unified Diff: chrome/test/webdriver/dispatch.cc

Issue 6723004: ChromeDriver should be able to focus on a frame using its frame element, (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 9 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
Index: chrome/test/webdriver/dispatch.cc
===================================================================
--- chrome/test/webdriver/dispatch.cc (revision 79141)
+++ chrome/test/webdriver/dispatch.cc (working copy)
@@ -59,6 +59,15 @@
shutdown_event->Signal();
}
+void SendNoContentResponse(struct mg_connection* connection,
+ const struct mg_request_info* request_info,
+ void* user_data) {
+ std::string response = "HTTP/1.1 204 No Content\r\n"
+ "Content-Length:0\r\n"
+ "\r\n";
+ mg_write(connection, response.data(), response.length());
+}
+
void SendNotImplementedError(struct mg_connection* connection,
const struct mg_request_info* request_info,
void* user_data) {
@@ -245,7 +254,11 @@
} // namespace internal
Dispatcher::Dispatcher(struct mg_context* context, const std::string& root)
- : context_(context), root_(root) {}
+ : context_(context), root_(root) {
+ // Overwrite mongoose's default handler for /favicon.ico to always return a
+ // 204 response so we don't spam the logs with 404s.
+ mg_set_uri_callback(context_, "/favicon.ico", &SendNoContentResponse, NULL);
+}
Dispatcher::~Dispatcher() {}

Powered by Google App Engine
This is Rietveld 408576698