| 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 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2467 const unsigned char kV3FrameData[] = { // Also applies for V2. | 2467 const unsigned char kV3FrameData[] = { // Also applies for V2. |
| 2468 0x80, spdy_version_ch_, 0x00, 0x03, | 2468 0x80, spdy_version_ch_, 0x00, 0x03, |
| 2469 0x00, 0x00, 0x00, 0x08, | 2469 0x00, 0x00, 0x00, 0x08, |
| 2470 0x7f, 0xff, 0xff, 0xff, | 2470 0x7f, 0xff, 0xff, 0xff, |
| 2471 0x00, 0x00, 0x00, 0x06, | 2471 0x00, 0x00, 0x00, 0x06, |
| 2472 }; | 2472 }; |
| 2473 const unsigned char kV4FrameData[] = { | 2473 const unsigned char kV4FrameData[] = { |
| 2474 0x00, 0x00, 0x04, 0x03, | 2474 0x00, 0x00, 0x04, 0x03, |
| 2475 0x00, 0x7f, 0xff, 0xff, | 2475 0x00, 0x7f, 0xff, 0xff, |
| 2476 0xff, 0x00, 0x00, 0x00, | 2476 0xff, 0x00, 0x00, 0x00, |
| 2477 0x06, | 2477 0x02, |
| 2478 }; | 2478 }; |
| 2479 SpdyRstStreamIR rst_stream(0x7FFFFFFF, | 2479 SpdyRstStreamIR rst_stream(0x7FFFFFFF, |
| 2480 RST_STREAM_INTERNAL_ERROR, | 2480 RST_STREAM_INTERNAL_ERROR, |
| 2481 ""); | 2481 ""); |
| 2482 scoped_ptr<SpdyFrame> frame(framer.SerializeRstStream(rst_stream)); | 2482 scoped_ptr<SpdyFrame> frame(framer.SerializeRstStream(rst_stream)); |
| 2483 if (IsSpdy4()) { | 2483 if (IsSpdy4()) { |
| 2484 CompareFrame(kDescription, *frame, kV4FrameData, arraysize(kV4FrameData)); | 2484 CompareFrame(kDescription, *frame, kV4FrameData, arraysize(kV4FrameData)); |
| 2485 } else { | 2485 } else { |
| 2486 CompareFrame(kDescription, *frame, kV3FrameData, arraysize(kV3FrameData)); | 2486 CompareFrame(kDescription, *frame, kV3FrameData, arraysize(kV3FrameData)); |
| 2487 } | 2487 } |
| (...skipping 3437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5925 TestSpdyVisitor visitor(spdy_version_); | 5925 TestSpdyVisitor visitor(spdy_version_); |
| 5926 visitor.SimulateInFramer(kFrameData, sizeof(kFrameData)); | 5926 visitor.SimulateInFramer(kFrameData, sizeof(kFrameData)); |
| 5927 | 5927 |
| 5928 EXPECT_EQ(SpdyFramer::SPDY_ERROR, visitor.framer_.state()); | 5928 EXPECT_EQ(SpdyFramer::SPDY_ERROR, visitor.framer_.state()); |
| 5929 EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME, | 5929 EXPECT_EQ(SpdyFramer::SPDY_INVALID_CONTROL_FRAME, |
| 5930 visitor.framer_.error_code()) | 5930 visitor.framer_.error_code()) |
| 5931 << SpdyFramer::ErrorCodeToString(visitor.framer_.error_code()); | 5931 << SpdyFramer::ErrorCodeToString(visitor.framer_.error_code()); |
| 5932 } | 5932 } |
| 5933 | 5933 |
| 5934 } // namespace net | 5934 } // namespace net |
| OLD | NEW |