| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/spdy/spdy_frame_builder.h" | 5 #include "net/spdy/spdy_frame_builder.h" |
| 6 | 6 |
| 7 #include "net/spdy/spdy_framer.h" | 7 #include "net/spdy/spdy_framer.h" |
| 8 #include "net/spdy/spdy_protocol.h" | 8 #include "net/spdy/spdy_protocol.h" |
| 9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 | 12 |
| 13 class SpdyFrameBuilderTest : public ::testing::TestWithParam<SpdyMajorVersion> { | 13 class SpdyFrameBuilderTest : public ::testing::TestWithParam<SpdyMajorVersion> { |
| 14 protected: | 14 protected: |
| 15 virtual void SetUp() { | 15 void SetUp() override { spdy_version_ = GetParam(); } |
| 16 spdy_version_ = GetParam(); | |
| 17 } | |
| 18 | 16 |
| 19 // Major version of SPDY protocol to be used. | 17 // Major version of SPDY protocol to be used. |
| 20 SpdyMajorVersion spdy_version_; | 18 SpdyMajorVersion spdy_version_; |
| 21 }; | 19 }; |
| 22 | 20 |
| 23 // All tests are run with two different SPDY versions: SPDY/2 and SPDY/3. | 21 // All tests are run with two different SPDY versions: SPDY/2 and SPDY/3. |
| 24 INSTANTIATE_TEST_CASE_P(SpdyFrameBuilderTests, | 22 INSTANTIATE_TEST_CASE_P(SpdyFrameBuilderTests, |
| 25 SpdyFrameBuilderTest, | 23 SpdyFrameBuilderTest, |
| 26 ::testing::Values(SPDY2, SPDY3, SPDY4)); | 24 ::testing::Values(SPDY2, SPDY3, SPDY4)); |
| 27 | 25 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 scoped_ptr<SpdyFrame> expected(framer.SerializeHeaders(headers_ir)); | 68 scoped_ptr<SpdyFrame> expected(framer.SerializeHeaders(headers_ir)); |
| 71 SpdyFrameBuilder builder(expected->size(), spdy_version_); | 69 SpdyFrameBuilder builder(expected->size(), spdy_version_); |
| 72 builder.BeginNewFrame(framer, HEADERS, 0, 1); | 70 builder.BeginNewFrame(framer, HEADERS, 0, 1); |
| 73 builder.OverwriteFlags(framer, HEADERS_FLAG_END_HEADERS); | 71 builder.OverwriteFlags(framer, HEADERS_FLAG_END_HEADERS); |
| 74 scoped_ptr<SpdyFrame> built(builder.take()); | 72 scoped_ptr<SpdyFrame> built(builder.take()); |
| 75 EXPECT_EQ(base::StringPiece(expected->data(), expected->size()), | 73 EXPECT_EQ(base::StringPiece(expected->data(), expected->size()), |
| 76 base::StringPiece(built->data(), built->size())); | 74 base::StringPiece(built->data(), built->size())); |
| 77 } | 75 } |
| 78 | 76 |
| 79 } // namespace net | 77 } // namespace net |
| OLD | NEW |