Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: net/socket/ssl_server_socket_unittest.cc

Issue 503113004: Remove implicit conversions from scoped_refptr to T* in net/socket/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | net/socket/tcp_socket_libevent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 public: 56 public:
57 FakeDataChannel() 57 FakeDataChannel()
58 : read_buf_len_(0), 58 : read_buf_len_(0),
59 closed_(false), 59 closed_(false),
60 write_called_after_close_(false), 60 write_called_after_close_(false),
61 weak_factory_(this) { 61 weak_factory_(this) {
62 } 62 }
63 63
64 int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback) { 64 int Read(IOBuffer* buf, int buf_len, const CompletionCallback& callback) {
65 DCHECK(read_callback_.is_null()); 65 DCHECK(read_callback_.is_null());
66 DCHECK(!read_buf_); 66 DCHECK(!read_buf_.get());
67 if (closed_) 67 if (closed_)
68 return 0; 68 return 0;
69 if (data_.empty()) { 69 if (data_.empty()) {
70 read_callback_ = callback; 70 read_callback_ = callback;
71 read_buf_ = buf; 71 read_buf_ = buf;
72 read_buf_len_ = buf_len; 72 read_buf_len_ = buf_len;
73 return ERR_IO_PENDING; 73 return ERR_IO_PENDING;
74 } 74 }
75 return PropogateData(buf, buf_len); 75 return PropogateData(buf, buf_len);
76 } 76 }
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 const char* kKeyingLabelBad = "EXPERIMENTAL-server-socket-test-bad"; 576 const char* kKeyingLabelBad = "EXPERIMENTAL-server-socket-test-bad";
577 unsigned char client_bad[kKeyingMaterialSize]; 577 unsigned char client_bad[kKeyingMaterialSize];
578 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad, 578 rv = client_socket_->ExportKeyingMaterial(kKeyingLabelBad,
579 false, kKeyingContext, 579 false, kKeyingContext,
580 client_bad, sizeof(client_bad)); 580 client_bad, sizeof(client_bad));
581 ASSERT_EQ(rv, OK); 581 ASSERT_EQ(rv, OK);
582 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out))); 582 EXPECT_NE(0, memcmp(server_out, client_bad, sizeof(server_out)));
583 } 583 }
584 584
585 } // namespace net 585 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | net/socket/tcp_socket_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698