| 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/crypto/crypto_framer.h" | 5 #include "net/quic/crypto/crypto_framer.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 ASSERT_TRUE(data.get() != nullptr); | 152 ASSERT_TRUE(data.get() != nullptr); |
| 153 | 153 |
| 154 test::CompareCharArraysWithHexError("constructed packet", data->data(), | 154 test::CompareCharArraysWithHexError("constructed packet", data->data(), |
| 155 data->length(), AsChars(packet), | 155 data->length(), AsChars(packet), |
| 156 arraysize(packet)); | 156 arraysize(packet)); |
| 157 } | 157 } |
| 158 | 158 |
| 159 TEST(CryptoFramerTest, ConstructHandshakeMessageTooManyEntries) { | 159 TEST(CryptoFramerTest, ConstructHandshakeMessageTooManyEntries) { |
| 160 CryptoHandshakeMessage message; | 160 CryptoHandshakeMessage message; |
| 161 message.set_tag(0xFFAA7733); | 161 message.set_tag(0xFFAA7733); |
| 162 for (uint32 key = 1; key <= kMaxEntries + 1; ++key) { | 162 for (uint32_t key = 1; key <= kMaxEntries + 1; ++key) { |
| 163 message.SetStringPiece(key, "abcdef"); | 163 message.SetStringPiece(key, "abcdef"); |
| 164 } | 164 } |
| 165 | 165 |
| 166 CryptoFramer framer; | 166 CryptoFramer framer; |
| 167 scoped_ptr<QuicData> data(framer.ConstructHandshakeMessage(message)); | 167 scoped_ptr<QuicData> data(framer.ConstructHandshakeMessage(message)); |
| 168 EXPECT_TRUE(data.get() == nullptr); | 168 EXPECT_TRUE(data.get() == nullptr); |
| 169 } | 169 } |
| 170 | 170 |
| 171 TEST(CryptoFramerTest, ConstructHandshakeMessageMinimumSize) { | 171 TEST(CryptoFramerTest, ConstructHandshakeMessageMinimumSize) { |
| 172 CryptoHandshakeMessage message; | 172 CryptoHandshakeMessage message; |
| (...skipping 289 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 |