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

Unified Diff: net/websockets/websocket_end_to_end_test.cc

Issue 1001353002: WebSocket ignores trailing whitespace test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/data/websocket/trailing-whitespace_wsh.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_end_to_end_test.cc
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index 0304eb160c0369f9693295ee483049c35eee6010..2fbc20b6ae65f7a984412a22482aa1f2f2aa9e76 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -242,12 +242,11 @@ class WebSocketEndToEndTest : public ::testing::Test {
if (!initialised_context_) {
InitialiseContext();
}
- std::vector<std::string> sub_protocols;
url::Origin origin("http://localhost");
event_interface_ = new ConnectTestingEventInterface;
channel_.reset(
new WebSocketChannel(make_scoped_ptr(event_interface_), &context_));
- channel_->SendAddChannelRequest(GURL(socket_url), sub_protocols, origin);
+ channel_->SendAddChannelRequest(GURL(socket_url), sub_protocols_, origin);
event_interface_->WaitForResponse();
return !event_interface_->failed();
}
@@ -256,6 +255,7 @@ class WebSocketEndToEndTest : public ::testing::Test {
scoped_ptr<TestNetworkDelegateWithProxyInfo> network_delegate_;
TestURLRequestContext context_;
scoped_ptr<WebSocketChannel> channel_;
+ std::vector<std::string> sub_protocols_;
bool initialised_context_;
};
@@ -456,6 +456,20 @@ TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(HstsWebSocketToWebSocket)) {
EXPECT_TRUE(ConnectAndWait(ws_url));
}
+// Regression test for crbug.com/180504 "WebSocket handshake fails when HTTP
+// headers have trailing LWS".
+TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(TrailingWhitespace)) {
+ SpawnedTestServer ws_server(SpawnedTestServer::TYPE_WS,
+ SpawnedTestServer::kLocalhost,
+ GetWebSocketTestDataDirectory());
+ ASSERT_TRUE(ws_server.Start());
+
+ GURL ws_url = ws_server.GetURL("trailing-whitespace");
+ sub_protocols_.push_back("sip");
+ EXPECT_TRUE(ConnectAndWait(ws_url));
+ EXPECT_EQ("sip", event_interface_->selected_subprotocol());
+}
+
} // namespace
} // namespace net
« no previous file with comments | « net/data/websocket/trailing-whitespace_wsh.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698