Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: net/spdy/spdy_framer_test.cc

Issue 8898003: Deprecate SpdyControlFrame::size in favor of SpdyControlFrame::kHeaderSize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "net/spdy/spdy_framer.h" 9 #include "net/spdy/spdy_framer.h"
10 #include "net/spdy/spdy_protocol.h" 10 #include "net/spdy/spdy_protocol.h"
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 framer.CreateSynStream(1, // stream_id 1586 framer.CreateSynStream(1, // stream_id
1587 0, // associated_stream_id 1587 0, // associated_stream_id
1588 1, // priority 1588 1, // priority
1589 CONTROL_FLAG_NONE, 1589 CONTROL_FLAG_NONE,
1590 false, // compress 1590 false, // compress
1591 &headers)); 1591 &headers));
1592 EXPECT_TRUE(template_frame.get() != NULL); 1592 EXPECT_TRUE(template_frame.get() != NULL);
1593 TestSpdyVisitor visitor; 1593 TestSpdyVisitor visitor;
1594 visitor.SimulateInFramer( 1594 visitor.SimulateInFramer(
1595 reinterpret_cast<unsigned char*>(template_frame.get()->data()), 1595 reinterpret_cast<unsigned char*>(template_frame.get()->data()),
1596 template_frame.get()->length() + SpdyControlFrame::size()); 1596 template_frame.get()->length() + SpdyControlFrame::kHeaderSize);
1597 EXPECT_EQ(1, visitor.syn_frame_count_); 1597 EXPECT_EQ(1, visitor.syn_frame_count_);
1598 } 1598 }
1599 } 1599 }
1600 1600
1601 TEST_F(SpdyFramerTest, ReadGarbage) { 1601 TEST_F(SpdyFramerTest, ReadGarbage) {
1602 SpdyFramer framer; 1602 SpdyFramer framer;
1603 unsigned char garbage_frame[256]; 1603 unsigned char garbage_frame[256];
1604 memset(garbage_frame, ~0, sizeof(garbage_frame)); 1604 memset(garbage_frame, ~0, sizeof(garbage_frame));
1605 TestSpdyVisitor visitor; 1605 TestSpdyVisitor visitor;
1606 visitor.use_compression_ = false; 1606 visitor.use_compression_ = false;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 // to make sure we don't crash. 1786 // to make sure we don't crash.
1787 if (frame.get() != NULL) { 1787 if (frame.get() != NULL) {
1788 // Now that same header block should decompress just fine. 1788 // Now that same header block should decompress just fine.
1789 SpdyHeaderBlock new_headers; 1789 SpdyHeaderBlock new_headers;
1790 decompress_framer.ParseHeaderBlock(frame.get(), &new_headers); 1790 decompress_framer.ParseHeaderBlock(frame.get(), &new_headers);
1791 } 1791 }
1792 } 1792 }
1793 } 1793 }
1794 1794
1795 } // namespace 1795 } // namespace
OLDNEW
« no previous file with comments | « net/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698