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

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, 10 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/websockets/websocket_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_test_util.cc
diff --git a/net/websockets/websocket_test_util.cc b/net/websockets/websocket_test_util.cc
index 0b0b8c04a248787790c106288b012cfb4dc6809d..3f963bf0e9437a4290333fe4e0bd440c47987c5e 100644
--- a/net/websockets/websocket_test_util.cc
+++ b/net/websockets/websocket_test_util.cc
@@ -37,6 +37,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, std::string(),
+ 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.
@@ -52,10 +62,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) {
« no previous file with comments | « net/websockets/websocket_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698