OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This test suite uses SSLClientSocket to test the implementation of | 5 // This test suite uses SSLClientSocket to test the implementation of |
6 // SSLServerSocket. In order to establish connections between the sockets | 6 // SSLServerSocket. In order to establish connections between the sockets |
7 // we need two additional classes: | 7 // we need two additional classes: |
8 // 1. FakeSocket | 8 // 1. FakeSocket |
9 // Connects SSL socket to FakeDataChannel. This class is just a stub. | 9 // Connects SSL socket to FakeDataChannel. This class is just a stub. |
10 // | 10 // |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 // The client writes some data. This should not cause an infinite loop. | 526 // The client writes some data. This should not cause an infinite loop. |
527 client_ret = client_socket_->Write( | 527 client_ret = client_socket_->Write( |
528 write_buf.get(), write_buf->size(), write_callback.callback()); | 528 write_buf.get(), write_buf->size(), write_callback.callback()); |
529 EXPECT_TRUE(client_ret > 0 || client_ret == ERR_IO_PENDING); | 529 EXPECT_TRUE(client_ret > 0 || client_ret == ERR_IO_PENDING); |
530 | 530 |
531 client_ret = write_callback.GetResult(client_ret); | 531 client_ret = write_callback.GetResult(client_ret); |
532 EXPECT_GT(client_ret, 0); | 532 EXPECT_GT(client_ret, 0); |
533 | 533 |
534 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 534 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
535 FROM_HERE, base::MessageLoop::QuitClosure(), | 535 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(), |
536 base::TimeDelta::FromMilliseconds(10)); | 536 base::TimeDelta::FromMilliseconds(10)); |
537 base::MessageLoop::current()->Run(); | 537 base::MessageLoop::current()->Run(); |
538 } | 538 } |
539 | 539 |
540 // This test executes ExportKeyingMaterial() on the client and server sockets, | 540 // This test executes ExportKeyingMaterial() on the client and server sockets, |
541 // after connecting them, and verifies that the results match. | 541 // after connecting them, and verifies that the results match. |
542 // This test will fail if False Start is enabled (see crbug.com/90208). | 542 // This test will fail if False Start is enabled (see crbug.com/90208). |
543 TEST_F(SSLServerSocketTest, ExportKeyingMaterial) { | 543 TEST_F(SSLServerSocketTest, ExportKeyingMaterial) { |
544 Initialize(); | 544 Initialize(); |
545 | 545 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 int server_ret = server_socket_->Handshake(handshake_callback.callback()); | 614 int server_ret = server_socket_->Handshake(handshake_callback.callback()); |
615 | 615 |
616 client_ret = connect_callback.GetResult(client_ret); | 616 client_ret = connect_callback.GetResult(client_ret); |
617 server_ret = handshake_callback.GetResult(server_ret); | 617 server_ret = handshake_callback.GetResult(server_ret); |
618 | 618 |
619 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, client_ret); | 619 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, client_ret); |
620 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, server_ret); | 620 ASSERT_EQ(ERR_SSL_VERSION_OR_CIPHER_MISMATCH, server_ret); |
621 } | 621 } |
622 | 622 |
623 } // namespace net | 623 } // namespace net |
OLD | NEW |