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

Unified Diff: chrome/test/chromedriver/net/test_http_server.cc

Issue 590653002: [chromedriver] Remove extra call to HttpServer::Close() and increase TestHttpServer buffer limit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 6 years, 3 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/chromedriver/net/test_http_server.cc
diff --git a/chrome/test/chromedriver/net/test_http_server.cc b/chrome/test/chromedriver/net/test_http_server.cc
index 1d19524d9157f6f22918f880a5742ff21611ee5f..f8795cc992c4b961be33a83f2585d52f79e823f1 100644
--- a/chrome/test/chromedriver/net/test_http_server.cc
+++ b/chrome/test/chromedriver/net/test_http_server.cc
@@ -16,6 +16,8 @@
#include "net/socket/tcp_server_socket.h"
#include "testing/gtest/include/gtest/gtest.h"
+const int kBufferSize = 100 * 1024 * 1024; // 100 MB
+
TestHttpServer::TestHttpServer()
: thread_("ServerThread"),
all_closed_event_(false, true),
@@ -73,9 +75,19 @@ GURL TestHttpServer::web_socket_url() const {
return web_socket_url_;
}
+void TestHttpServer::OnHttpRequest(
+ int connection_id,
+ const net::HttpServerRequestInfo& info) {
+ server_->SetSendBufferSize(connection_id, kBufferSize);
+ server_->SetReceiveBufferSize(connection_id, kBufferSize);
+}
+
void TestHttpServer::OnWebSocketRequest(
int connection_id,
const net::HttpServerRequestInfo& info) {
+ server_->SetSendBufferSize(connection_id, kBufferSize);
+ server_->SetReceiveBufferSize(connection_id, kBufferSize);
+
WebSocketRequestAction action;
{
base::AutoLock lock(action_lock_);
@@ -99,6 +111,8 @@ void TestHttpServer::OnWebSocketRequest(
void TestHttpServer::OnWebSocketMessage(int connection_id,
const std::string& data) {
+ server_->SetSendBufferSize(connection_id, kBufferSize);
+ server_->SetReceiveBufferSize(connection_id, kBufferSize);
WebSocketMessageAction action;
{
base::AutoLock lock(action_lock_);
« no previous file with comments | « chrome/test/chromedriver/net/test_http_server.h ('k') | chrome/test/chromedriver/server/chromedriver_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698