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/spdy/spdy_framer.h" | 5 #include "net/spdy/spdy_framer.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 5516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5527 | 5527 |
5528 framer.ProcessInput(frame->data(), framer.GetSynStreamMinimumSize()); | 5528 framer.ProcessInput(frame->data(), framer.GetSynStreamMinimumSize()); |
5529 EXPECT_EQ(SpdyFramer::SPDY_READY_FOR_FRAME, framer.state()); | 5529 EXPECT_EQ(SpdyFramer::SPDY_READY_FOR_FRAME, framer.state()); |
5530 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code()) | 5530 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code()) |
5531 << SpdyFramer::ErrorCodeToString(framer.error_code()); | 5531 << SpdyFramer::ErrorCodeToString(framer.error_code()); |
5532 } | 5532 } |
5533 | 5533 |
5534 TEST_P(SpdyFramerTest, SettingsFlagsAndId) { | 5534 TEST_P(SpdyFramerTest, SettingsFlagsAndId) { |
5535 const uint32 kId = 0x020304; | 5535 const uint32 kId = 0x020304; |
5536 const uint32 kFlags = 0x01; | 5536 const uint32 kFlags = 0x01; |
5537 const uint32 kWireFormat = htonl(IsSpdy2() ? 0x04030201 : 0x01020304); | 5537 const uint32 kWireFormat = |
| 5538 base::HostToNet32(IsSpdy2() ? 0x04030201 : 0x01020304); |
5538 | 5539 |
5539 SettingsFlagsAndId id_and_flags = | 5540 SettingsFlagsAndId id_and_flags = |
5540 SettingsFlagsAndId::FromWireFormat(spdy_version_, kWireFormat); | 5541 SettingsFlagsAndId::FromWireFormat(spdy_version_, kWireFormat); |
5541 EXPECT_EQ(kId, id_and_flags.id()); | 5542 EXPECT_EQ(kId, id_and_flags.id()); |
5542 EXPECT_EQ(kFlags, id_and_flags.flags()); | 5543 EXPECT_EQ(kFlags, id_and_flags.flags()); |
5543 EXPECT_EQ(kWireFormat, id_and_flags.GetWireFormat(spdy_version_)); | 5544 EXPECT_EQ(kWireFormat, id_and_flags.GetWireFormat(spdy_version_)); |
5544 } | 5545 } |
5545 | 5546 |
5546 // Test handling of a RST_STREAM with out-of-bounds status codes. | 5547 // Test handling of a RST_STREAM with out-of-bounds status codes. |
5547 TEST_P(SpdyFramerTest, RstStreamStatusBounds) { | 5548 TEST_P(SpdyFramerTest, RstStreamStatusBounds) { |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6066 | 6067 |
6067 EXPECT_EQ(1, visitor->data_frame_count_); | 6068 EXPECT_EQ(1, visitor->data_frame_count_); |
6068 EXPECT_EQ(strlen(four_score), static_cast<unsigned>(visitor->data_bytes_)); | 6069 EXPECT_EQ(strlen(four_score), static_cast<unsigned>(visitor->data_bytes_)); |
6069 EXPECT_EQ(0, visitor->headers_frame_count_); | 6070 EXPECT_EQ(0, visitor->headers_frame_count_); |
6070 } | 6071 } |
6071 } | 6072 } |
6072 | 6073 |
6073 } // namespace test | 6074 } // namespace test |
6074 | 6075 |
6075 } // namespace net | 6076 } // namespace net |
OLD | NEW |