| Index: webrtc/rtc_base/ssladapter_unittest.cc
|
| diff --git a/webrtc/rtc_base/ssladapter_unittest.cc b/webrtc/rtc_base/ssladapter_unittest.cc
|
| index 929b14f87b4af0dfdd08aae6b4e27117443f033d..5c61f6a2f7d54e4a691221e84df203b134ef0354 100644
|
| --- a/webrtc/rtc_base/ssladapter_unittest.cc
|
| +++ b/webrtc/rtc_base/ssladapter_unittest.cc
|
| @@ -52,7 +52,7 @@ class SSLAdapterTestDummyClient : public sigslot::has_slots<> {
|
| // Ignore any certificate errors for the purpose of testing.
|
| // Note: We do this only because we don't have a real certificate.
|
| // NEVER USE THIS IN PRODUCTION CODE!
|
| - ssl_adapter_->set_ignore_bad_cert(true);
|
| + ssl_adapter_->SetIgnoreBadCert(true);
|
|
|
| ssl_adapter_->SignalReadEvent.connect(this,
|
| &SSLAdapterTestDummyClient::OnSSLAdapterReadEvent);
|
| @@ -60,6 +60,10 @@ class SSLAdapterTestDummyClient : public sigslot::has_slots<> {
|
| &SSLAdapterTestDummyClient::OnSSLAdapterCloseEvent);
|
| }
|
|
|
| + void SetAlpnProtocols(const std::vector<std::string>& protos) {
|
| + ssl_adapter_->SetAlpnProtocols(protos);
|
| + }
|
| +
|
| rtc::SocketAddress GetAddress() const {
|
| return ssl_adapter_->GetLocalAddress();
|
| }
|
| @@ -282,6 +286,10 @@ class SSLAdapterTestBase : public testing::Test,
|
| handshake_wait_ = wait;
|
| }
|
|
|
| + void SetAlpnProtocols(const std::vector<std::string>& protos) {
|
| + client_->SetAlpnProtocols(protos);
|
| + }
|
| +
|
| void TestHandshake(bool expect_success) {
|
| int rv;
|
|
|
| @@ -434,6 +442,14 @@ TEST_F(SSLAdapterTestTLS_ECDSA, TestTLSTransfer) {
|
| TestTransfer("Hello, world!");
|
| }
|
|
|
| +// Test transfer using ALPN with protos as h2 and http/1.1
|
| +TEST_F(SSLAdapterTestTLS_ECDSA, TestTLSALPN) {
|
| + std::vector<std::string> alpn_protos{"h2", "http/1.1"};
|
| + SetAlpnProtocols(alpn_protos);
|
| + TestHandshake(true);
|
| + TestTransfer("Hello, world!");
|
| +}
|
| +
|
| // Basic tests: DTLS
|
|
|
| // Test that handshake works, using RSA
|
|
|