Commit 725e3aed authored by hiroshige's avatar hiroshige Committed by Commit bot

Revert of Add WebSocketDispatcherHostTest.InvalidScheme (patchset #3 id:40001...

Revert of Add WebSocketDispatcherHostTest.InvalidScheme (patchset #3 id:40001 of https://codereview.chromium.org/1000883004/)

Reason for revert:
Speculatively revert for https://crbug.com/467471

Original issue's description:
> Add WebSocketDispatcherHostTest.InvalidScheme
>
> This is a regression test for
> https://codereview.chromium.org/998173003/.
>
> BUG=466335
>
> Committed: https://crrev.com/6a8de59ae3ecd7b04bee2ddec89eb7075fbd1871
> Cr-Commit-Position: refs/heads/master@{#320262}

TBR=ricea@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=466335

Review URL: https://codereview.chromium.org/1007263002

Cr-Commit-Position: refs/heads/master@{#320704}
parent 4f078b9b
......@@ -410,33 +410,5 @@ TEST_F(WebSocketDispatcherHostTest, NotRejectedAfter255FailedConnections) {
EXPECT_EQ(0, dispatcher_host_->num_succeeded_connections());
}
// This is a regression test for https://crrev.com/998173003/.
TEST_F(WebSocketDispatcherHostTest, InvalidScheme) {
int routing_id = 123;
GURL socket_url("http://example.com/test");
std::vector<std::string> requested_protocols;
requested_protocols.push_back("hello");
url::Origin origin("http://example.com");
int render_frame_id = -2;
WebSocketHostMsg_AddChannelRequest message(
routing_id, socket_url, requested_protocols, origin, render_frame_id);
ASSERT_TRUE(dispatcher_host_->OnMessageReceived(message));
ASSERT_EQ(1U, mock_hosts_.size());
MockWebSocketHost* host = mock_hosts_[0];
// Tests that WebSocketHost::OnMessageReceived() doesn't cause a crash and
// the connection with an invalid scheme fails here.
// We call WebSocketHost::OnMessageReceived() here explicitly because
// MockWebSocketHost does not call WebSocketHost::OnMessageReceived() for
// WebSocketHostMsg_AddChannelRequest.
host->WebSocketHost::OnMessageReceived(message);
EXPECT_EQ(0, dispatcher_host_->num_pending_connections());
EXPECT_EQ(1, dispatcher_host_->num_failed_connections());
EXPECT_EQ(0, dispatcher_host_->num_succeeded_connections());
}
} // namespace
} // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment