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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return incoming_->Read(buf, buf_len, callback); | 171 return incoming_->Read(buf, buf_len, callback); |
172 } | 172 } |
173 | 173 |
174 virtual int Write(IOBuffer* buf, int buf_len, | 174 virtual int Write(IOBuffer* buf, int buf_len, |
175 const CompletionCallback& callback) OVERRIDE { | 175 const CompletionCallback& callback) OVERRIDE { |
176 // Write random number of bytes. | 176 // Write random number of bytes. |
177 buf_len = rand() % buf_len + 1; | 177 buf_len = rand() % buf_len + 1; |
178 return outgoing_->Write(buf, buf_len, callback); | 178 return outgoing_->Write(buf, buf_len, callback); |
179 } | 179 } |
180 | 180 |
181 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE { | 181 virtual int SetReceiveBufferSize(int32 size) OVERRIDE { |
182 return true; | 182 return net::OK; |
183 } | 183 } |
184 | 184 |
185 virtual bool SetSendBufferSize(int32 size) OVERRIDE { | 185 virtual int SetSendBufferSize(int32 size) OVERRIDE { |
186 return true; | 186 return net::OK; |
187 } | 187 } |
188 | 188 |
189 virtual int Connect(const CompletionCallback& callback) OVERRIDE { | 189 virtual int Connect(const CompletionCallback& callback) OVERRIDE { |
190 return net::OK; | 190 return net::OK; |
191 } | 191 } |
192 | 192 |
193 virtual void Disconnect() OVERRIDE { | 193 virtual void Disconnect() OVERRIDE { |
194 incoming_->Close(); | 194 incoming_->Close(); |
195 outgoing_->Close(); | 195 outgoing_->Close(); |
196 } | 196 } |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 unsigned char client_bad[kKeyingMaterialSize]; | 576 unsigned char client_bad[kKeyingMaterialSize]; |
577 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, | 577 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, |
578 false, kKeyingContext, | 578 false, kKeyingContext, |
579 client_bad, sizeof(client_bad)); | 579 client_bad, sizeof(client_bad)); |
580 ASSERT_EQ(rv, net::OK); | 580 ASSERT_EQ(rv, net::OK); |
581 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); | 581 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); |
582 } | 582 } |
583 #endif | 583 #endif |
584 | 584 |
585 } // namespace net | 585 } // namespace net |
OLD | NEW |