| 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 #include "net/quic/test_tools/crypto_test_utils.h" | 5 #include "net/quic/test_tools/crypto_test_utils.h" |
| 6 | 6 |
| 7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
| 8 #include "net/quic/crypto/crypto_handshake.h" | 8 #include "net/quic/crypto/crypto_handshake.h" |
| 9 #include "net/quic/crypto/crypto_server_config.h" | 9 #include "net/quic/crypto/crypto_server_config.h" |
| 10 #include "net/quic/crypto/quic_decrypter.h" | 10 #include "net/quic/crypto/quic_decrypter.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); | 38 MOCK_METHOD0(CreateOutgoingReliableStream, ReliableQuicStream*()); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 // CryptoFramerVisitor is a framer visitor that records handshake messages. | 41 // CryptoFramerVisitor is a framer visitor that records handshake messages. |
| 42 class CryptoFramerVisitor : public CryptoFramerVisitorInterface { | 42 class CryptoFramerVisitor : public CryptoFramerVisitorInterface { |
| 43 public: | 43 public: |
| 44 CryptoFramerVisitor() | 44 CryptoFramerVisitor() |
| 45 : error_(false) { | 45 : error_(false) { |
| 46 } | 46 } |
| 47 | 47 |
| 48 void OnError(CryptoFramer* framer) { | 48 virtual void OnError(CryptoFramer* framer) OVERRIDE { |
| 49 error_ = true; | 49 error_ = true; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void OnHandshakeMessage(const CryptoHandshakeMessage& message) { | 52 virtual void OnHandshakeMessage( |
| 53 const CryptoHandshakeMessage& message) OVERRIDE { |
| 53 messages_.push_back(message); | 54 messages_.push_back(message); |
| 54 } | 55 } |
| 55 | 56 |
| 56 bool error() const { | 57 bool error() const { |
| 57 return error_; | 58 return error_; |
| 58 } | 59 } |
| 59 | 60 |
| 60 const vector<CryptoHandshakeMessage>& messages() const { | 61 const vector<CryptoHandshakeMessage>& messages() const { |
| 61 return messages_; | 62 return messages_; |
| 62 } | 63 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 client_decrypter_key.data(), | 250 client_decrypter_key.data(), |
| 250 client_decrypter_key.length()); | 251 client_decrypter_key.length()); |
| 251 CompareCharArraysWithHexError("server write IV", | 252 CompareCharArraysWithHexError("server write IV", |
| 252 server_encrypter_iv.data(), | 253 server_encrypter_iv.data(), |
| 253 server_encrypter_iv.length(), | 254 server_encrypter_iv.length(), |
| 254 client_decrypter_iv.data(), | 255 client_decrypter_iv.data(), |
| 255 client_decrypter_iv.length()); | 256 client_decrypter_iv.length()); |
| 256 } | 257 } |
| 257 } // namespace test | 258 } // namespace test |
| 258 } // namespace net | 259 } // namespace net |
| OLD | NEW |