| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <iostream> | 6 #include <iostream> |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 using net::test::SetFrameFlags; | 603 using net::test::SetFrameFlags; |
| 604 using net::test::CompareCharArraysWithHexError; | 604 using net::test::CompareCharArraysWithHexError; |
| 605 using net::test::SpdyFramerTestUtil; | 605 using net::test::SpdyFramerTestUtil; |
| 606 using net::test::TestSpdyVisitor; | 606 using net::test::TestSpdyVisitor; |
| 607 using net::test::GetSerializedHeaders; | 607 using net::test::GetSerializedHeaders; |
| 608 | 608 |
| 609 namespace net { | 609 namespace net { |
| 610 | 610 |
| 611 class SpdyFramerTest : public ::testing::TestWithParam<SpdyMajorVersion> { | 611 class SpdyFramerTest : public ::testing::TestWithParam<SpdyMajorVersion> { |
| 612 protected: | 612 protected: |
| 613 virtual void SetUp() { | 613 void SetUp() override { |
| 614 spdy_version_ = GetParam(); | 614 spdy_version_ = GetParam(); |
| 615 spdy_version_ch_ = static_cast<unsigned char>( | 615 spdy_version_ch_ = static_cast<unsigned char>( |
| 616 SpdyConstants::SerializeMajorVersion(spdy_version_)); | 616 SpdyConstants::SerializeMajorVersion(spdy_version_)); |
| 617 } | 617 } |
| 618 | 618 |
| 619 void CompareFrame(const string& description, | 619 void CompareFrame(const string& description, |
| 620 const SpdyFrame& actual_frame, | 620 const SpdyFrame& actual_frame, |
| 621 const unsigned char* expected, | 621 const unsigned char* expected, |
| 622 const int expected_len) { | 622 const int expected_len) { |
| 623 const unsigned char* actual = | 623 const unsigned char* actual = |
| (...skipping 5132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5756 TestSpdyVisitor visitor(spdy_version_); | 5756 TestSpdyVisitor visitor(spdy_version_); |
| 5757 visitor.SimulateInFramer(kFrameData, sizeof(kFrameData)); | 5757 visitor.SimulateInFramer(kFrameData, sizeof(kFrameData)); |
| 5758 | 5758 |
| 5759 EXPECT_EQ(SpdyFramer::SPDY_ERROR, visitor.framer_.state()); | 5759 EXPECT_EQ(SpdyFramer::SPDY_ERROR, visitor.framer_.state()); |
| 5760 EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME, | 5760 EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME, |
| 5761 visitor.framer_.error_code()) | 5761 visitor.framer_.error_code()) |
| 5762 << SpdyFramer::ErrorCodeToString(visitor.framer_.error_code()); | 5762 << SpdyFramer::ErrorCodeToString(visitor.framer_.error_code()); |
| 5763 } | 5763 } |
| 5764 | 5764 |
| 5765 } // namespace net | 5765 } // namespace net |
| OLD | NEW |