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

Side by Side Diff: jingle/notifier/base/fake_ssl_client_socket_unittest.cc

Issue 9958028: Add a new GetNegotiatedProtocol method to StreamSocket and implement in all subclasses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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 | Annotate | Revision Log
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 #include "jingle/notifier/base/fake_ssl_client_socket.h" 5 #include "jingle/notifier/base/fake_ssl_client_socket.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 MOCK_CONST_METHOD0(IsConnectedAndIdle, bool()); 59 MOCK_CONST_METHOD0(IsConnectedAndIdle, bool());
60 MOCK_CONST_METHOD1(GetPeerAddress, int(net::AddressList*)); 60 MOCK_CONST_METHOD1(GetPeerAddress, int(net::AddressList*));
61 MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*)); 61 MOCK_CONST_METHOD1(GetLocalAddress, int(net::IPEndPoint*));
62 MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&()); 62 MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&());
63 MOCK_METHOD0(SetSubresourceSpeculation, void()); 63 MOCK_METHOD0(SetSubresourceSpeculation, void());
64 MOCK_METHOD0(SetOmniboxSpeculation, void()); 64 MOCK_METHOD0(SetOmniboxSpeculation, void());
65 MOCK_CONST_METHOD0(WasEverUsed, bool()); 65 MOCK_CONST_METHOD0(WasEverUsed, bool());
66 MOCK_CONST_METHOD0(UsingTCPFastOpen, bool()); 66 MOCK_CONST_METHOD0(UsingTCPFastOpen, bool());
67 MOCK_CONST_METHOD0(NumBytesRead, int64()); 67 MOCK_CONST_METHOD0(NumBytesRead, int64());
68 MOCK_CONST_METHOD0(GetConnectTimeMicros, base::TimeDelta()); 68 MOCK_CONST_METHOD0(GetConnectTimeMicros, base::TimeDelta());
69 MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto());
69 }; 70 };
70 71
71 // Break up |data| into a bunch of chunked MockReads/Writes and push 72 // Break up |data| into a bunch of chunked MockReads/Writes and push
72 // them onto |ops|. 73 // them onto |ops|.
73 void AddChunkedOps(base::StringPiece data, size_t chunk_size, net::IoMode mode, 74 void AddChunkedOps(base::StringPiece data, size_t chunk_size, net::IoMode mode,
74 std::vector<net::MockRead>* ops) { 75 std::vector<net::MockRead>* ops) {
75 DCHECK_GT(chunk_size, 0U); 76 DCHECK_GT(chunk_size, 0U);
76 size_t offset = 0; 77 size_t offset = 0;
77 while (offset < data.size()) { 78 while (offset < data.size()) {
78 size_t bounded_chunk_size = std::min(data.size() - offset, chunk_size); 79 size_t bounded_chunk_size = std::min(data.size() - offset, chunk_size);
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 340 }
340 341
341 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { 342 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) {
342 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO, 343 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO,
343 VERIFY_SERVER_HELLO_ERROR); 344 VERIFY_SERVER_HELLO_ERROR);
344 } 345 }
345 346
346 } // namespace 347 } // namespace
347 348
348 } // namespace notifier 349 } // namespace notifier
OLDNEW
« no previous file with comments | « jingle/notifier/base/fake_ssl_client_socket.cc ('k') | jingle/notifier/base/proxy_resolving_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698