OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/websockets/websocket_stream.h" | 5 #include "net/websockets/websocket_stream.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 WaitUntilConnectDone(); | 1120 WaitUntilConnectDone(); |
1121 EXPECT_TRUE(has_failed()); | 1121 EXPECT_TRUE(has_failed()); |
1122 } | 1122 } |
1123 | 1123 |
1124 TEST_F(WebSocketStreamCreateTest, SelfSignedCertificateSuccess) { | 1124 TEST_F(WebSocketStreamCreateTest, SelfSignedCertificateSuccess) { |
1125 scoped_ptr<SSLSocketDataProvider> ssl_data( | 1125 scoped_ptr<SSLSocketDataProvider> ssl_data( |
1126 new SSLSocketDataProvider(ASYNC, ERR_CERT_AUTHORITY_INVALID)); | 1126 new SSLSocketDataProvider(ASYNC, ERR_CERT_AUTHORITY_INVALID)); |
1127 ssl_data->cert = | 1127 ssl_data->cert = |
1128 ImportCertFromFile(GetTestCertsDirectory(), "unittest.selfsigned.der"); | 1128 ImportCertFromFile(GetTestCertsDirectory(), "unittest.selfsigned.der"); |
1129 ASSERT_TRUE(ssl_data->cert.get()); | 1129 ASSERT_TRUE(ssl_data->cert.get()); |
1130 ssl_data_.push_back(ssl_data.release()); | 1130 ssl_data_.push_back(ssl_data.Pass()); |
1131 ssl_data.reset(new SSLSocketDataProvider(ASYNC, OK)); | 1131 ssl_data.reset(new SSLSocketDataProvider(ASYNC, OK)); |
1132 ssl_data_.push_back(ssl_data.release()); | 1132 ssl_data_.push_back(ssl_data.Pass()); |
1133 url_request_context_host_.AddRawExpectations(BuildNullSocketData()); | 1133 url_request_context_host_.AddRawExpectations(BuildNullSocketData()); |
1134 CreateAndConnectStandard("wss://localhost/", "localhost", "/", | 1134 CreateAndConnectStandard("wss://localhost/", "localhost", "/", |
1135 NoSubProtocols(), "http://localhost", "", ""); | 1135 NoSubProtocols(), "http://localhost", "", ""); |
1136 // WaitUntilConnectDone doesn't work in this case. | 1136 // WaitUntilConnectDone doesn't work in this case. |
1137 base::RunLoop().RunUntilIdle(); | 1137 base::RunLoop().RunUntilIdle(); |
1138 ASSERT_TRUE(ssl_error_callbacks_); | 1138 ASSERT_TRUE(ssl_error_callbacks_); |
1139 ssl_error_callbacks_->ContinueSSLRequest(); | 1139 ssl_error_callbacks_->ContinueSSLRequest(); |
1140 WaitUntilConnectDone(); | 1140 WaitUntilConnectDone(); |
1141 EXPECT_FALSE(has_failed()); | 1141 EXPECT_FALSE(has_failed()); |
1142 EXPECT_TRUE(stream_); | 1142 EXPECT_TRUE(stream_); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 CreateAndConnectRawExpectations("ws://localhost/", NoSubProtocols(), | 1311 CreateAndConnectRawExpectations("ws://localhost/", NoSubProtocols(), |
1312 "http://localhost", socket_data.Pass()); | 1312 "http://localhost", socket_data.Pass()); |
1313 WaitUntilConnectDone(); | 1313 WaitUntilConnectDone(); |
1314 EXPECT_TRUE(has_failed()); | 1314 EXPECT_TRUE(has_failed()); |
1315 EXPECT_EQ("Establishing a tunnel via proxy server failed.", | 1315 EXPECT_EQ("Establishing a tunnel via proxy server failed.", |
1316 failure_message()); | 1316 failure_message()); |
1317 } | 1317 } |
1318 | 1318 |
1319 } // namespace | 1319 } // namespace |
1320 } // namespace net | 1320 } // namespace net |
OLD | NEW |