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 4735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4746 | 4746 |
4747 EXPECT_CALL(debug_visitor, OnSendCompressedFrame(42, HEADERS, _, _)); | 4747 EXPECT_CALL(debug_visitor, OnSendCompressedFrame(42, HEADERS, _, _)); |
4748 EXPECT_CALL(debug_visitor, OnReceiveCompressedFrame(42, HEADERS, _)); | 4748 EXPECT_CALL(debug_visitor, OnReceiveCompressedFrame(42, HEADERS, _)); |
4749 EXPECT_CALL(visitor, OnHeaders(42, 0, false)); | 4749 EXPECT_CALL(visitor, OnHeaders(42, 0, false)); |
4750 EXPECT_CALL(visitor, OnControlFrameHeaderData(42, _, _)) | 4750 EXPECT_CALL(visitor, OnControlFrameHeaderData(42, _, _)) |
4751 .WillRepeatedly(testing::Return(true)); | 4751 .WillRepeatedly(testing::Return(true)); |
4752 EXPECT_CALL(debug_visitor, OnSendCompressedFrame(42, CONTINUATION, _, _)); | 4752 EXPECT_CALL(debug_visitor, OnSendCompressedFrame(42, CONTINUATION, _, _)); |
4753 | 4753 |
4754 SpdyHeadersIR headers_ir(42); | 4754 SpdyHeadersIR headers_ir(42); |
4755 headers_ir.SetHeader("foo", "bar"); | 4755 headers_ir.SetHeader("foo", "bar"); |
4756 headers_ir.set_end_headers(false); | |
4757 scoped_ptr<SpdyFrame> frame0(framer.SerializeHeaders(headers_ir)); | 4756 scoped_ptr<SpdyFrame> frame0(framer.SerializeHeaders(headers_ir)); |
| 4757 SetFrameFlags(frame0.get(), 0, spdy_version_); |
4758 | 4758 |
4759 SpdyContinuationIR continuation(42); | 4759 SpdyContinuationIR continuation(42); |
4760 continuation.SetHeader("foo", "bar"); | 4760 continuation.SetHeader("foo", "bar"); |
4761 scoped_ptr<SpdySerializedFrame> frame( | 4761 scoped_ptr<SpdySerializedFrame> frame( |
4762 framer.SerializeContinuation(continuation)); | 4762 framer.SerializeContinuation(continuation)); |
4763 SetFrameFlags(frame.get(), flags, spdy_version_); | 4763 SetFrameFlags(frame.get(), flags, spdy_version_); |
4764 | 4764 |
4765 if (flags & ~(HEADERS_FLAG_END_HEADERS)) { | 4765 if (flags & ~(HEADERS_FLAG_END_HEADERS)) { |
4766 EXPECT_CALL(visitor, OnError(_)); | 4766 EXPECT_CALL(visitor, OnError(_)); |
4767 } else { | 4767 } else { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4953 SpdyBlockedIR blocked_ir(0); | 4953 SpdyBlockedIR blocked_ir(0); |
4954 scoped_ptr<SpdySerializedFrame> frame(framer.SerializeFrame(blocked_ir)); | 4954 scoped_ptr<SpdySerializedFrame> frame(framer.SerializeFrame(blocked_ir)); |
4955 framer.ProcessInput(frame->data(), framer.GetBlockedSize()); | 4955 framer.ProcessInput(frame->data(), framer.GetBlockedSize()); |
4956 | 4956 |
4957 EXPECT_EQ(SpdyFramer::SPDY_RESET, framer.state()); | 4957 EXPECT_EQ(SpdyFramer::SPDY_RESET, framer.state()); |
4958 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code()) | 4958 EXPECT_EQ(SpdyFramer::SPDY_NO_ERROR, framer.error_code()) |
4959 << SpdyFramer::ErrorCodeToString(framer.error_code()); | 4959 << SpdyFramer::ErrorCodeToString(framer.error_code()); |
4960 } | 4960 } |
4961 | 4961 |
4962 } // namespace net | 4962 } // namespace net |
OLD | NEW |