Commit 63842f09 authored by Bence Béky's avatar Bence Béky Committed by Commit Bot

Remove WebSocketStreamCreateTestBase::ssl_data_.

Change-Id: I1f0d494f0a1d83cde0c632aec642fadecbe7b9b3
Reviewed-on: https://chromium-review.googlesource.com/946628Reviewed-by: default avatarAdam Rice <ricea@chromium.org>
Commit-Queue: Bence Béky <bnc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540813}
parent 222973e4
......@@ -125,7 +125,8 @@ class WebSocketStreamServerSetCookieTest
TEST_P(WebSocketStreamClientUseCookieTest, ClientUseCookie) {
// For wss tests.
ssl_data_.push_back(std::make_unique<SSLSocketDataProvider>(ASYNC, OK));
url_request_context_host_.AddSSLSocketDataProvider(
std::make_unique<SSLSocketDataProvider>(ASYNC, OK));
CookieStore* store =
url_request_context_host_.GetURLRequestContext()->cookie_store();
......@@ -161,7 +162,8 @@ TEST_P(WebSocketStreamClientUseCookieTest, ClientUseCookie) {
TEST_P(WebSocketStreamServerSetCookieTest, ServerSetCookie) {
// For wss tests.
ssl_data_.push_back(std::make_unique<SSLSocketDataProvider>(ASYNC, OK));
url_request_context_host_.AddSSLSocketDataProvider(
std::make_unique<SSLSocketDataProvider>(ASYNC, OK));
const GURL url(GetParam().url);
const GURL cookie_url(GetParam().cookie_url);
......
......@@ -87,10 +87,6 @@ void WebSocketStreamCreateTestBase::CreateAndConnectStream(
const GURL& site_for_cookies,
const std::string& additional_headers,
std::unique_ptr<base::Timer> timer) {
for (size_t i = 0; i < ssl_data_.size(); ++i) {
url_request_context_host_.AddSSLSocketDataProvider(std::move(ssl_data_[i]));
}
ssl_data_.clear();
std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate(
new TestConnectDelegate(this, connect_run_loop_.QuitClosure()));
WebSocketStream::ConnectDelegate* delegate = connect_delegate.get();
......
......@@ -75,7 +75,6 @@ class WebSocketStreamCreateTestBase {
ssl_error_callbacks_;
SSLInfo ssl_info_;
bool ssl_fatal_;
std::vector<std::unique_ptr<SSLSocketDataProvider>> ssl_data_;
URLRequest* url_request_;
// This temporarily sets WebSocketEndpointLockManager unlock delay to zero
......
......@@ -1268,11 +1268,13 @@ TEST_P(WebSocketStreamCreateTest, NoResponse) {
}
TEST_P(WebSocketStreamCreateTest, SelfSignedCertificateFailure) {
ssl_data_.push_back(std::make_unique<SSLSocketDataProvider>(
ASYNC, ERR_CERT_AUTHORITY_INVALID));
ssl_data_[0]->ssl_info.cert =
auto ssl_socket_data = std::make_unique<SSLSocketDataProvider>(
ASYNC, ERR_CERT_AUTHORITY_INVALID);
ssl_socket_data->ssl_info.cert =
ImportCertFromFile(GetTestCertsDirectory(), "unittest.selfsigned.der");
ASSERT_TRUE(ssl_data_[0]->ssl_info.cert.get());
ASSERT_TRUE(ssl_socket_data->ssl_info.cert.get());
url_request_context_host_.AddSSLSocketDataProvider(
std::move(ssl_socket_data));
std::unique_ptr<SequencedSocketData> raw_socket_data(BuildNullSocketData());
CreateAndConnectRawExpectations("wss://www.example.org/", NoSubProtocols(),
Origin(), Url(), "",
......@@ -1288,12 +1290,15 @@ TEST_P(WebSocketStreamCreateTest, SelfSignedCertificateFailure) {
}
TEST_P(WebSocketStreamCreateTest, SelfSignedCertificateSuccess) {
ssl_data_.push_back(std::make_unique<SSLSocketDataProvider>(
ASYNC, ERR_CERT_AUTHORITY_INVALID));
ssl_data_[0]->ssl_info.cert =
auto ssl_socket_data = std::make_unique<SSLSocketDataProvider>(
ASYNC, ERR_CERT_AUTHORITY_INVALID);
ssl_socket_data->ssl_info.cert =
ImportCertFromFile(GetTestCertsDirectory(), "unittest.selfsigned.der");
ASSERT_TRUE(ssl_data_[0]->ssl_info.cert.get());
ssl_data_.push_back(std::make_unique<SSLSocketDataProvider>(ASYNC, OK));
ASSERT_TRUE(ssl_socket_data->ssl_info.cert.get());
url_request_context_host_.AddSSLSocketDataProvider(
std::move(ssl_socket_data));
url_request_context_host_.AddSSLSocketDataProvider(
std::make_unique<SSLSocketDataProvider>(ASYNC, OK));
url_request_context_host_.AddRawExpectations(BuildNullSocketData());
CreateAndConnectStandard("wss://www.example.org/", "www.example.org", "/",
NoSubProtocols(), Origin(), Url(), {}, {}, {});
......
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