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 5854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5865 | 5865 |
5866 testing::StrictMock<test::MockSpdyFramerVisitor> visitor; | 5866 testing::StrictMock<test::MockSpdyFramerVisitor> visitor; |
5867 SpdyFramer framer(spdy_version_); | 5867 SpdyFramer framer(spdy_version_); |
5868 framer.set_visitor(&visitor); | 5868 framer.set_visitor(&visitor); |
5869 | 5869 |
5870 if (IsSpdy3()) { | 5870 if (IsSpdy3()) { |
5871 EXPECT_CALL(visitor, OnRstStream(1, RST_STREAM_INVALID)); | 5871 EXPECT_CALL(visitor, OnRstStream(1, RST_STREAM_INVALID)); |
5872 framer.ProcessInput(reinterpret_cast<const char*>(kV3RstStreamInvalid), | 5872 framer.ProcessInput(reinterpret_cast<const char*>(kV3RstStreamInvalid), |
5873 arraysize(kV3RstStreamInvalid)); | 5873 arraysize(kV3RstStreamInvalid)); |
5874 } else { | 5874 } else { |
5875 EXPECT_CALL(visitor, OnRstStream(1, RST_STREAM_INTERNAL_ERROR)); | 5875 EXPECT_CALL(visitor, OnRstStream(1, RST_STREAM_NO_ERROR)); |
5876 framer.ProcessInput(reinterpret_cast<const char*>(kH2RstStreamInvalid), | 5876 framer.ProcessInput(reinterpret_cast<const char*>(kH2RstStreamInvalid), |
5877 arraysize(kH2RstStreamInvalid)); | 5877 arraysize(kH2RstStreamInvalid)); |
5878 } | 5878 } |
5879 EXPECT_EQ(SpdyFramer::SPDY_READY_FOR_FRAME, framer.state()); | 5879 EXPECT_EQ(SpdyFramer::SPDY_READY_FOR_FRAME, framer.state()); |
5880 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code()) | 5880 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code()) |
5881 << SpdyFramer::ErrorCodeToString(framer.error_code()); | 5881 << SpdyFramer::ErrorCodeToString(framer.error_code()); |
5882 | 5882 |
5883 framer.Reset(); | 5883 framer.Reset(); |
5884 | 5884 |
5885 if (IsSpdy3()) { | 5885 if (IsSpdy3()) { |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6392 | 6392 |
6393 EXPECT_EQ(1, visitor->data_frame_count_); | 6393 EXPECT_EQ(1, visitor->data_frame_count_); |
6394 EXPECT_EQ(strlen(four_score), static_cast<unsigned>(visitor->data_bytes_)); | 6394 EXPECT_EQ(strlen(four_score), static_cast<unsigned>(visitor->data_bytes_)); |
6395 EXPECT_EQ(0, visitor->headers_frame_count_); | 6395 EXPECT_EQ(0, visitor->headers_frame_count_); |
6396 } | 6396 } |
6397 } | 6397 } |
6398 | 6398 |
6399 } // namespace test | 6399 } // namespace test |
6400 | 6400 |
6401 } // namespace net | 6401 } // namespace net |
OLD | NEW |