| 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/core/crypto/crypto_framer.h" | 5 #include "net/quic/core/crypto/crypto_framer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 ++error_count_; | 41 ++error_count_; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override { | 44 void OnHandshakeMessage(const CryptoHandshakeMessage& message) override { |
| 45 messages_.push_back(message); | 45 messages_.push_back(message); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Counters from the visitor callbacks. | 48 // Counters from the visitor callbacks. |
| 49 int error_count_; | 49 int error_count_; |
| 50 | 50 |
| 51 vector<CryptoHandshakeMessage> messages_; | 51 std::vector<CryptoHandshakeMessage> messages_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 TEST(CryptoFramerTest, ConstructHandshakeMessage) { | 54 TEST(CryptoFramerTest, ConstructHandshakeMessage) { |
| 55 CryptoHandshakeMessage message; | 55 CryptoHandshakeMessage message; |
| 56 message.set_tag(0xFFAA7733); | 56 message.set_tag(0xFFAA7733); |
| 57 message.SetStringPiece(0x12345678, "abcdef"); | 57 message.SetStringPiece(0x12345678, "abcdef"); |
| 58 message.SetStringPiece(0x12345679, "ghijk"); | 58 message.SetStringPiece(0x12345679, "ghijk"); |
| 59 message.SetStringPiece(0x1234567A, "lmnopqr"); | 59 message.SetStringPiece(0x1234567A, "lmnopqr"); |
| 60 | 60 |
| 61 unsigned char packet[] = { | 61 unsigned char packet[] = { |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 }; | 462 }; |
| 463 | 463 |
| 464 EXPECT_TRUE( | 464 EXPECT_TRUE( |
| 465 framer.ProcessInput(StringPiece(AsChars(input), arraysize(input)))); | 465 framer.ProcessInput(StringPiece(AsChars(input), arraysize(input)))); |
| 466 EXPECT_EQ(0, visitor.error_count_); | 466 EXPECT_EQ(0, visitor.error_count_); |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace test | 469 } // namespace test |
| 470 | 470 |
| 471 } // namespace net | 471 } // namespace net |
| OLD | NEW |