diff options
author | ricea <ricea@chromium.org> | 2015-07-28 07:12:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-28 14:12:57 +0000 |
commit | 8c1d9ec45775e3d20e4bb596221b9dcd37dcdd04 (patch) | |
tree | b5105c7251e1b70dbd0cda0dcc02c7be4527696e /net/websockets | |
parent | 18b35fda0680d5a1f13f67144b73dce42c22b94e (diff) | |
download | chromium_src-8c1d9ec45775e3d20e4bb596221b9dcd37dcdd04.zip chromium_src-8c1d9ec45775e3d20e4bb596221b9dcd37dcdd04.tar.gz chromium_src-8c1d9ec45775e3d20e4bb596221b9dcd37dcdd04.tar.bz2 |
Remove unused params in WebSocketHandshakeStreamCreateHelperTest
Several parameters to
WebSocketHandshakeStreamCreateHelperTest::CreateAndInitializeStream() were
always passed the same values. Remove them.
BUG=
TEST=net_unittests
Review URL: https://codereview.chromium.org/1256793008
Cr-Commit-Position: refs/heads/master@{#340676}
Diffstat (limited to 'net/websockets')
-rw-r--r-- | net/websockets/websocket_handshake_stream_create_helper_test.cc | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/net/websockets/websocket_handshake_stream_create_helper_test.cc b/net/websockets/websocket_handshake_stream_create_helper_test.cc index 2ebbd8e..17a388a 100644 --- a/net/websockets/websocket_handshake_stream_create_helper_test.cc +++ b/net/websockets/websocket_handshake_stream_create_helper_test.cc @@ -76,21 +76,18 @@ class TestConnectDelegate : public WebSocketStream::ConnectDelegate { 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, const std::string& extra_request_headers, const std::string& extra_response_headers) { + static const char kOrigin[] = "http://localhost"; WebSocketHandshakeStreamCreateHelper create_helper(&connect_delegate_, sub_protocols); create_helper.set_failure_message(&failure_message_); scoped_ptr<ClientSocketHandle> socket_handle = socket_handle_factory_.CreateClientSocketHandle( - WebSocketStandardRequest(socket_path, socket_host, - url::Origin(GURL(origin)), + WebSocketStandardRequest("/", "localhost", + url::Origin(GURL(kOrigin)), extra_request_headers), WebSocketStandardResponse(extra_response_headers)); @@ -104,7 +101,7 @@ class WebSocketHandshakeStreamCreateHelperTest : public ::testing::Test { ->SetWebSocketKeyForTesting("dGhlIHNhbXBsZSBub25jZQ=="); HttpRequestInfo request_info; - request_info.url = GURL(socket_url); + request_info.url = GURL("ws://localhost/"); request_info.method = "GET"; request_info.load_flags = LOAD_DISABLE_CACHE; int rv = handshake->InitializeStream( @@ -117,7 +114,7 @@ class WebSocketHandshakeStreamCreateHelperTest : public ::testing::Test { headers.SetHeader("Pragma", "no-cache"); headers.SetHeader("Cache-Control", "no-cache"); headers.SetHeader("Upgrade", "websocket"); - headers.SetHeader("Origin", origin); + headers.SetHeader("Origin", kOrigin); headers.SetHeader("Sec-WebSocket-Version", "13"); headers.SetHeader("User-Agent", ""); headers.SetHeader("Accept-Encoding", "gzip, deflate"); @@ -145,9 +142,8 @@ class WebSocketHandshakeStreamCreateHelperTest : public ::testing::Test { // Confirm that the basic case works as expected. TEST_F(WebSocketHandshakeStreamCreateHelperTest, BasicStream) { - scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream( - "ws://localhost/", "localhost", "/", std::vector<std::string>(), - "http://localhost", "", ""); + scoped_ptr<WebSocketStream> stream = + CreateAndInitializeStream(std::vector<std::string>(), "", ""); EXPECT_EQ("", stream->GetExtensions()); EXPECT_EQ("", stream->GetSubProtocol()); } @@ -158,8 +154,7 @@ TEST_F(WebSocketHandshakeStreamCreateHelperTest, SubProtocols) { sub_protocols.push_back("chat"); sub_protocols.push_back("superchat"); scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream( - "ws://localhost/", "localhost", "/", sub_protocols, "http://localhost", - "Sec-WebSocket-Protocol: chat, superchat\r\n", + sub_protocols, "Sec-WebSocket-Protocol: chat, superchat\r\n", "Sec-WebSocket-Protocol: superchat\r\n"); EXPECT_EQ("superchat", stream->GetSubProtocol()); } @@ -168,8 +163,7 @@ TEST_F(WebSocketHandshakeStreamCreateHelperTest, SubProtocols) { // websocket_stream_test.cc. TEST_F(WebSocketHandshakeStreamCreateHelperTest, Extensions) { scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream( - "ws://localhost/", "localhost", "/", std::vector<std::string>(), - "http://localhost", "", + std::vector<std::string>(), "", "Sec-WebSocket-Extensions: permessage-deflate\r\n"); EXPECT_EQ("permessage-deflate", stream->GetExtensions()); } @@ -178,8 +172,7 @@ TEST_F(WebSocketHandshakeStreamCreateHelperTest, Extensions) { // websocket_stream_test.cc. TEST_F(WebSocketHandshakeStreamCreateHelperTest, ExtensionParameters) { scoped_ptr<WebSocketStream> stream = CreateAndInitializeStream( - "ws://localhost/", "localhost", "/", std::vector<std::string>(), - "http://localhost", "", + std::vector<std::string>(), "", "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"); |