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

Unified Diff: components/grpc_support/test/quic_test_server.cc

Issue 2829703002: Prototype of HttpProtocolHandler perf test with ARC.
Patch Set: Created 3 years, 8 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 | « components/grpc_support/test/quic_test_server.h ('k') | ios/net/crn_http_protocol_handler.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/grpc_support/test/quic_test_server.cc
diff --git a/components/grpc_support/test/quic_test_server.cc b/components/grpc_support/test/quic_test_server.cc
index d57f94ce706abf6220ba0ea996ed7e52ebf9b0f7..4b56f34253b1ea77b2ab9e2fce957dc4da0f18b8 100644
--- a/components/grpc_support/test/quic_test_server.cc
+++ b/components/grpc_support/test/quic_test_server.cc
@@ -40,6 +40,14 @@ const char kHelloHeaderValue[] = "hello header value";
const char kHelloTrailerName[] = "hello_trailer";
const char kHelloTrailerValue[] = "hello trailer value";
+const char kTestServerSimpleUrl[] = "https://test.example.com/simple.txt";
+const char kSimplePath[] = "/simple.txt";
+const char kSimpleBodyValue[] = "Simple Hello from QUIC Server";
+const char kSimpleStatus[] = "200";
+
+const char kSimpleHeaderName[] = "hello_header";
+const char kSimpleHeaderValue[] = "hello header value";
+
base::Thread* g_quic_server_thread = nullptr;
net::QuicHttpResponseCache* g_quic_response_cache = nullptr;
net::QuicSimpleServer* g_quic_server = nullptr;
@@ -55,6 +63,11 @@ void SetupQuicHttpResponseCache() {
g_quic_response_cache->AddResponse(base::StringPrintf("%s", kTestServerHost),
kHelloPath, std::move(headers),
kHelloBodyValue, std::move(trailers));
+ headers[kSimpleHeaderName] = kSimpleHeaderValue;
+ headers[kStatusHeader] = kSimpleStatus;
+ g_quic_response_cache->AddResponse(base::StringPrintf("%s", kTestServerHost),
+ kSimplePath, std::move(headers),
+ kSimpleBodyValue);
}
void StartQuicServerOnServerThread(const base::FilePath& test_files_root,
@@ -72,7 +85,6 @@ void StartQuicServerOnServerThread(const base::FilePath& test_files_root,
directory.AppendASCII("quic_test.example.com.crt"),
directory.AppendASCII("quic_test.example.com.key.pkcs8"),
directory.AppendASCII("quic_test.example.com.key.sct")));
-
SetupQuicHttpResponseCache();
g_quic_server = new net::QuicSimpleServer(
@@ -85,7 +97,6 @@ void StartQuicServerOnServerThread(const base::FilePath& test_files_root,
net::IPEndPoint(net::IPAddress::IPv4AllZeros(), 0));
CHECK_GE(rv, 0) << "Quic server fails to start";
g_quic_server_port = g_quic_server->server_address().port();
-
server_started_event->Signal();
}
« no previous file with comments | « components/grpc_support/test/quic_test_server.h ('k') | ios/net/crn_http_protocol_handler.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698