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

Unified Diff: net/websockets/websocket_handshake_stream_create_helper_test.cc

Issue 863253002: Update from https://crrev.com/312600 (Closed) Base URL: https://github.com/domokit/mojo.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_handshake_stream_create_helper_test.cc
diff --git a/net/websockets/websocket_handshake_stream_create_helper_test.cc b/net/websockets/websocket_handshake_stream_create_helper_test.cc
index 512de243596feca4f10ebed564e9d4701267146c..8edbc66efe3fc54162ec48988952c8cabff18106 100644
--- a/net/websockets/websocket_handshake_stream_create_helper_test.cc
+++ b/net/websockets/websocket_handshake_stream_create_helper_test.cc
@@ -78,6 +78,7 @@ class WebSocketHandshakeStreamCreateHelperTest : public ::testing::Test {
protected:
scoped_ptr<WebSocketStream> CreateAndInitializeStream(
const std::string& socket_url,
+ const std::string& socket_host,
const std::string& socket_path,
const std::vector<std::string>& sub_protocols,
const std::string& origin,
@@ -89,8 +90,8 @@ class WebSocketHandshakeStreamCreateHelperTest : public ::testing::Test {
scoped_ptr<ClientSocketHandle> socket_handle =
socket_handle_factory_.CreateClientSocketHandle(
- WebSocketStandardRequest(
- socket_path, origin, extra_request_headers),
+ WebSocketStandardRequest(socket_path, socket_host, origin,
+ extra_request_headers),
WebSocketStandardResponse(extra_response_headers));
scoped_ptr<WebSocketHandshakeStreamBase> handshake(
@@ -144,10 +145,9 @@ class WebSocketHandshakeStreamCreateHelperTest : public ::testing::Test {
// Confirm that the basic case works as expected.
TEST_F(WebSocketHandshakeStreamCreateHelperTest, BasicStream) {
- scoped_ptr<WebSocketStream> stream =
- CreateAndInitializeStream("ws://localhost/", "/",
- std::vector<std::string>(), "http://localhost/",
- "", "");
+ scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream(
+ "ws://localhost/", "localhost", "/", std::vector<std::string>(),
+ "http://localhost/", "", "");
EXPECT_EQ("", stream->GetExtensions());
EXPECT_EQ("", stream->GetSubProtocol());
}
@@ -157,13 +157,10 @@ TEST_F(WebSocketHandshakeStreamCreateHelperTest, SubProtocols) {
std::vector<std::string> sub_protocols;
sub_protocols.push_back("chat");
sub_protocols.push_back("superchat");
- scoped_ptr<WebSocketStream> stream =
- CreateAndInitializeStream("ws://localhost/",
- "/",
- sub_protocols,
- "http://localhost/",
- "Sec-WebSocket-Protocol: chat, superchat\r\n",
- "Sec-WebSocket-Protocol: superchat\r\n");
+ scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream(
+ "ws://localhost/", "localhost", "/", sub_protocols, "http://localhost/",
+ "Sec-WebSocket-Protocol: chat, superchat\r\n",
+ "Sec-WebSocket-Protocol: superchat\r\n");
EXPECT_EQ("superchat", stream->GetSubProtocol());
}
@@ -171,11 +168,8 @@ TEST_F(WebSocketHandshakeStreamCreateHelperTest, SubProtocols) {
// websocket_stream_test.cc.
TEST_F(WebSocketHandshakeStreamCreateHelperTest, Extensions) {
scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream(
- "ws://localhost/",
- "/",
- std::vector<std::string>(),
- "http://localhost/",
- "",
+ "ws://localhost/", "localhost", "/", std::vector<std::string>(),
+ "http://localhost/", "",
"Sec-WebSocket-Extensions: permessage-deflate\r\n");
EXPECT_EQ("permessage-deflate", stream->GetExtensions());
}
@@ -184,11 +178,8 @@ TEST_F(WebSocketHandshakeStreamCreateHelperTest, Extensions) {
// websocket_stream_test.cc.
TEST_F(WebSocketHandshakeStreamCreateHelperTest, ExtensionParameters) {
scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream(
- "ws://localhost/",
- "/",
- std::vector<std::string>(),
- "http://localhost/",
- "",
+ "ws://localhost/", "localhost", "/", std::vector<std::string>(),
+ "http://localhost/", "",
"Sec-WebSocket-Extensions: permessage-deflate;"
" client_max_window_bits=14; server_max_window_bits=14;"
" server_no_context_takeover; client_no_context_takeover\r\n");

Powered by Google App Engine
This is Rietveld 408576698