| Index: net/socket/ssl_client_socket_unittest.cc
|
| diff --git a/net/socket/ssl_client_socket_unittest.cc b/net/socket/ssl_client_socket_unittest.cc
|
| index 05844cd0ef327d6c01ccbc847826cd1e3e0a7b76..a44448ccc30572106aaed093f42a40d6d72062e4 100644
|
| --- a/net/socket/ssl_client_socket_unittest.cc
|
| +++ b/net/socket/ssl_client_socket_unittest.cc
|
| @@ -162,7 +162,8 @@ ReadBufferingStreamSocket::ReadBufferingStreamSocket(
|
| scoped_ptr<StreamSocket> transport)
|
| : WrappedStreamSocket(transport.Pass()),
|
| read_buffer_(new GrowableIOBuffer()),
|
| - buffer_size_(0) {}
|
| + buffer_size_(0) {
|
| +}
|
|
|
| void ReadBufferingStreamSocket::SetBufferSize(int size) {
|
| DCHECK(!user_read_buf_.get());
|
| @@ -298,7 +299,8 @@ SynchronousErrorStreamSocket::SynchronousErrorStreamSocket(
|
| have_read_error_(false),
|
| pending_read_error_(OK),
|
| have_write_error_(false),
|
| - pending_write_error_(OK) {}
|
| + pending_write_error_(OK) {
|
| +}
|
|
|
| int SynchronousErrorStreamSocket::Read(IOBuffer* buf,
|
| int buf_len,
|
| @@ -394,7 +396,8 @@ FakeBlockingStreamSocket::FakeBlockingStreamSocket(
|
| should_block_read_(false),
|
| pending_read_result_(ERR_IO_PENDING),
|
| should_block_write_(false),
|
| - pending_write_len_(-1) {}
|
| + pending_write_len_(-1) {
|
| +}
|
|
|
| int FakeBlockingStreamSocket::Read(IOBuffer* buf,
|
| int len,
|
| @@ -403,8 +406,11 @@ int FakeBlockingStreamSocket::Read(IOBuffer* buf,
|
| DCHECK_EQ(ERR_IO_PENDING, pending_read_result_);
|
| DCHECK(!callback.is_null());
|
|
|
| - int rv = transport_->Read(buf, len, base::Bind(
|
| - &FakeBlockingStreamSocket::OnReadCompleted, base::Unretained(this)));
|
| + int rv =
|
| + transport_->Read(buf,
|
| + len,
|
| + base::Bind(&FakeBlockingStreamSocket::OnReadCompleted,
|
| + base::Unretained(this)));
|
| if (rv == ERR_IO_PENDING) {
|
| // Save the callback to be called later.
|
| pending_read_callback_ = callback;
|
| @@ -486,8 +492,8 @@ void FakeBlockingStreamSocket::UnblockWrite() {
|
| if (!pending_write_buf_)
|
| return;
|
|
|
| - int rv = transport_->Write(pending_write_buf_, pending_write_len_,
|
| - pending_write_callback_);
|
| + int rv = transport_->Write(
|
| + pending_write_buf_, pending_write_len_, pending_write_callback_);
|
| pending_write_buf_ = NULL;
|
| pending_write_len_ = -1;
|
| if (rv == ERR_IO_PENDING) {
|
| @@ -631,9 +637,8 @@ class SSLClientSocketFalseStartTest : public SSLClientSocketTest {
|
| void TestFalseStart(const SpawnedTestServer::SSLOptions& server_options,
|
| const SSLConfig& client_config,
|
| bool expect_false_start) {
|
| - SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS,
|
| - server_options,
|
| - base::FilePath());
|
| + SpawnedTestServer test_server(
|
| + SpawnedTestServer::TYPE_HTTPS, server_options, base::FilePath());
|
| ASSERT_TRUE(test_server.Start());
|
|
|
| AddressList addr;
|
| @@ -690,9 +695,8 @@ class SSLClientSocketFalseStartTest : public SSLClientSocketTest {
|
| memcpy(request_buffer->data(), request_text, kRequestTextSize);
|
|
|
| // Write the request.
|
| - rv = callback.GetResult(sock->Write(request_buffer.get(),
|
| - kRequestTextSize,
|
| - callback.callback()));
|
| + rv = callback.GetResult(sock->Write(
|
| + request_buffer.get(), kRequestTextSize, callback.callback()));
|
| EXPECT_EQ(kRequestTextSize, rv);
|
|
|
| // The read will hang; it's waiting for the peer to complete the
|
| @@ -1700,23 +1704,24 @@ TEST_F(SSLClientSocketTest, PrematureApplicationData) {
|
| TestCompletionCallback callback;
|
|
|
| static const unsigned char application_data[] = {
|
| - 0x17, 0x03, 0x01, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x46, 0x03, 0x01, 0x4b,
|
| - 0xc2, 0xf8, 0xb2, 0xc1, 0x56, 0x42, 0xb9, 0x57, 0x7f, 0xde, 0x87, 0x46,
|
| - 0xf7, 0xa3, 0x52, 0x42, 0x21, 0xf0, 0x13, 0x1c, 0x9c, 0x83, 0x88, 0xd6,
|
| - 0x93, 0x0c, 0xf6, 0x36, 0x30, 0x05, 0x7e, 0x20, 0xb5, 0xb5, 0x73, 0x36,
|
| - 0x53, 0x83, 0x0a, 0xfc, 0x17, 0x63, 0xbf, 0xa0, 0xe4, 0x42, 0x90, 0x0d,
|
| - 0x2f, 0x18, 0x6d, 0x20, 0xd8, 0x36, 0x3f, 0xfc, 0xe6, 0x01, 0xfa, 0x0f,
|
| - 0xa5, 0x75, 0x7f, 0x09, 0x00, 0x04, 0x00, 0x16, 0x03, 0x01, 0x11, 0x57,
|
| - 0x0b, 0x00, 0x11, 0x53, 0x00, 0x11, 0x50, 0x00, 0x06, 0x22, 0x30, 0x82,
|
| - 0x06, 0x1e, 0x30, 0x82, 0x05, 0x06, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02,
|
| - 0x0a};
|
| + 0x17, 0x03, 0x01, 0x00, 0x4a, 0x02, 0x00, 0x00, 0x46, 0x03, 0x01,
|
| + 0x4b, 0xc2, 0xf8, 0xb2, 0xc1, 0x56, 0x42, 0xb9, 0x57, 0x7f, 0xde,
|
| + 0x87, 0x46, 0xf7, 0xa3, 0x52, 0x42, 0x21, 0xf0, 0x13, 0x1c, 0x9c,
|
| + 0x83, 0x88, 0xd6, 0x93, 0x0c, 0xf6, 0x36, 0x30, 0x05, 0x7e, 0x20,
|
| + 0xb5, 0xb5, 0x73, 0x36, 0x53, 0x83, 0x0a, 0xfc, 0x17, 0x63, 0xbf,
|
| + 0xa0, 0xe4, 0x42, 0x90, 0x0d, 0x2f, 0x18, 0x6d, 0x20, 0xd8, 0x36,
|
| + 0x3f, 0xfc, 0xe6, 0x01, 0xfa, 0x0f, 0xa5, 0x75, 0x7f, 0x09, 0x00,
|
| + 0x04, 0x00, 0x16, 0x03, 0x01, 0x11, 0x57, 0x0b, 0x00, 0x11, 0x53,
|
| + 0x00, 0x11, 0x50, 0x00, 0x06, 0x22, 0x30, 0x82, 0x06, 0x1e, 0x30,
|
| + 0x82, 0x05, 0x06, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x0a};
|
|
|
| // All reads and writes complete synchronously (async=false).
|
| MockRead data_reads[] = {
|
| MockRead(SYNCHRONOUS,
|
| reinterpret_cast<const char*>(application_data),
|
| arraysize(application_data)),
|
| - MockRead(SYNCHRONOUS, OK), };
|
| + MockRead(SYNCHRONOUS, OK),
|
| + };
|
|
|
| StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0);
|
|
|
| @@ -1741,7 +1746,8 @@ TEST_F(SSLClientSocketTest, CipherSuiteDisables) {
|
| // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml,
|
| // only disabling those cipher suites that the test server actually
|
| // implements.
|
| - const uint16 kCiphersToDisable[] = {0x0005, // TLS_RSA_WITH_RC4_128_SHA
|
| + const uint16 kCiphersToDisable[] = {
|
| + 0x0005, // TLS_RSA_WITH_RC4_128_SHA
|
| };
|
|
|
| SpawnedTestServer::SSLOptions ssl_options;
|
| @@ -2090,15 +2096,15 @@ TEST_F(SSLClientSocketCertRequestInfoTest, TwoAuthorities) {
|
| const base::FilePath::CharType kDiginotarFile[] =
|
| FILE_PATH_LITERAL("diginotar_root_ca.pem");
|
| const unsigned char kDiginotarDN[] = {
|
| - 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
|
| - 0x02, 0x4e, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55, 0x04, 0x0a,
|
| - 0x13, 0x09, 0x44, 0x69, 0x67, 0x69, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x31,
|
| - 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x11, 0x44, 0x69,
|
| - 0x67, 0x69, 0x4e, 0x6f, 0x74, 0x61, 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74,
|
| - 0x20, 0x43, 0x41, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48,
|
| - 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, 0x16, 0x11, 0x69, 0x6e, 0x66, 0x6f,
|
| - 0x40, 0x64, 0x69, 0x67, 0x69, 0x6e, 0x6f, 0x74, 0x61, 0x72, 0x2e, 0x6e,
|
| - 0x6c};
|
| + 0x30, 0x5f, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06,
|
| + 0x13, 0x02, 0x4e, 0x4c, 0x31, 0x12, 0x30, 0x10, 0x06, 0x03, 0x55,
|
| + 0x04, 0x0a, 0x13, 0x09, 0x44, 0x69, 0x67, 0x69, 0x4e, 0x6f, 0x74,
|
| + 0x61, 0x72, 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x03,
|
| + 0x13, 0x11, 0x44, 0x69, 0x67, 0x69, 0x4e, 0x6f, 0x74, 0x61, 0x72,
|
| + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x31, 0x20, 0x30,
|
| + 0x1e, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09,
|
| + 0x01, 0x16, 0x11, 0x69, 0x6e, 0x66, 0x6f, 0x40, 0x64, 0x69, 0x67,
|
| + 0x69, 0x6e, 0x6f, 0x74, 0x61, 0x72, 0x2e, 0x6e, 0x6c};
|
| const size_t kDiginotarLen = sizeof(kDiginotarDN);
|
|
|
| SpawnedTestServer::SSLOptions ssl_options;
|
| @@ -2121,9 +2127,8 @@ TEST_F(SSLClientSocketTest, ConnectSignedCertTimestampsEnabledTLSExtension) {
|
| SpawnedTestServer::SSLOptions ssl_options;
|
| ssl_options.signed_cert_timestamps_tls_ext = "test";
|
|
|
| - SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS,
|
| - ssl_options,
|
| - base::FilePath());
|
| + SpawnedTestServer test_server(
|
| + SpawnedTestServer::TYPE_HTTPS, ssl_options, base::FilePath());
|
| ASSERT_TRUE(test_server.Start());
|
|
|
| AddressList addr;
|
| @@ -2177,9 +2182,8 @@ TEST_F(SSLClientSocketTest, ConnectSignedCertTimestampsEnabledOCSP) {
|
| // for a freshly minted certificate.
|
| ssl_options.server_certificate = SpawnedTestServer::SSLOptions::CERT_AUTO;
|
|
|
| - SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS,
|
| - ssl_options,
|
| - base::FilePath());
|
| + SpawnedTestServer test_server(
|
| + SpawnedTestServer::TYPE_HTTPS, ssl_options, base::FilePath());
|
| ASSERT_TRUE(test_server.Start());
|
|
|
| AddressList addr;
|
| @@ -2232,9 +2236,8 @@ TEST_F(SSLClientSocketTest, ConnectSignedCertTimestampsDisabled) {
|
| SpawnedTestServer::SSLOptions ssl_options;
|
| ssl_options.signed_cert_timestamps_tls_ext = "test";
|
|
|
| - SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS,
|
| - ssl_options,
|
| - base::FilePath());
|
| + SpawnedTestServer test_server(
|
| + SpawnedTestServer::TYPE_HTTPS, ssl_options, base::FilePath());
|
| ASSERT_TRUE(test_server.Start());
|
|
|
| AddressList addr;
|
|
|