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

Unified Diff: net/websockets/websocket_test_util.cc

Issue 869073002: Add WebSocket cookie tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: net/websockets/websocket_test_util.cc
diff --git a/net/websockets/websocket_test_util.cc b/net/websockets/websocket_test_util.cc
index 6091c9e0be16a1a95d48e2c7cb7ba5f37b41eda7..5acfa25b474abfdd8cca264ed5de85eac8d0af0d 100644
--- a/net/websockets/websocket_test_util.cc
+++ b/net/websockets/websocket_test_util.cc
@@ -36,6 +36,16 @@ std::string WebSocketStandardRequest(const std::string& path,
const std::string& host,
const std::string& origin,
const std::string& extra_headers) {
+ return WebSocketStandardRequestWithCookies(path, host, origin, "",
Ryan Sleevi 2015/02/02 20:14:43 s/""/std::string()/
yhirano 2015/02/09 10:50:16 Done.
+ extra_headers);
+}
+
+std::string WebSocketStandardRequestWithCookies(
+ const std::string& path,
+ const std::string& host,
+ const std::string& origin,
+ const std::string& cookies,
+ const std::string& extra_headers) {
// Unrelated changes in net/http may change the order and default-values of
// HTTP headers, causing WebSocket tests to fail. It is safe to update this
// string in that case.
@@ -51,10 +61,12 @@ std::string WebSocketStandardRequest(const std::string& path,
"User-Agent:\r\n"
"Accept-Encoding: gzip, deflate\r\n"
"Accept-Language: en-us,fr\r\n"
+ "%s"
"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n"
"Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits\r\n"
"%s\r\n",
- path.c_str(), host.c_str(), origin.c_str(), extra_headers.c_str());
+ path.c_str(), host.c_str(), origin.c_str(), cookies.c_str(),
+ extra_headers.c_str());
}
std::string WebSocketStandardResponse(const std::string& extra_headers) {
« net/websockets/websocket_test_util.h ('K') | « net/websockets/websocket_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698