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

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

Issue 141953004: SPDY cleanup: remove credential slot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix inadvertent rebase on upstream branches. Created 6 years, 10 months 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/buffered_spdy_framer.cc ('k') | net/spdy/mock_spdy_framer_visitor.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) 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/buffered_spdy_framer.h" 5 #include "net/spdy/buffered_spdy_framer.h"
6 6
7 #include "net/spdy/spdy_test_util_common.h" 7 #include "net/spdy/spdy_test_util_common.h"
8 #include "testing/platform_test.h" 8 #include "testing/platform_test.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 21 matching lines...) Expand all
32 SpdyStreamId stream_id, 32 SpdyStreamId stream_id,
33 const std::string& description) OVERRIDE { 33 const std::string& description) OVERRIDE {
34 LOG(INFO) << "SpdyFramer Error on stream: " << stream_id << " " 34 LOG(INFO) << "SpdyFramer Error on stream: " << stream_id << " "
35 << description; 35 << description;
36 error_count_++; 36 error_count_++;
37 } 37 }
38 38
39 virtual void OnSynStream(SpdyStreamId stream_id, 39 virtual void OnSynStream(SpdyStreamId stream_id,
40 SpdyStreamId associated_stream_id, 40 SpdyStreamId associated_stream_id,
41 SpdyPriority priority, 41 SpdyPriority priority,
42 uint8 credential_slot,
43 bool fin, 42 bool fin,
44 bool unidirectional, 43 bool unidirectional,
45 const SpdyHeaderBlock& headers) OVERRIDE { 44 const SpdyHeaderBlock& headers) OVERRIDE {
46 header_stream_id_ = stream_id; 45 header_stream_id_ = stream_id;
47 EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream); 46 EXPECT_NE(header_stream_id_, SpdyFramer::kInvalidStream);
48 syn_frame_count_++; 47 syn_frame_count_++;
49 headers_ = headers; 48 headers_ = headers;
50 } 49 }
51 50
52 virtual void OnSynReply(SpdyStreamId stream_id, 51 virtual void OnSynReply(SpdyStreamId stream_id,
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 213
215 TEST_P(BufferedSpdyFramerTest, ReadSynStreamHeaderBlock) { 214 TEST_P(BufferedSpdyFramerTest, ReadSynStreamHeaderBlock) {
216 SpdyHeaderBlock headers; 215 SpdyHeaderBlock headers;
217 headers["aa"] = "vv"; 216 headers["aa"] = "vv";
218 headers["bb"] = "ww"; 217 headers["bb"] = "ww";
219 BufferedSpdyFramer framer(spdy_version(), true); 218 BufferedSpdyFramer framer(spdy_version(), true);
220 scoped_ptr<SpdyFrame> control_frame( 219 scoped_ptr<SpdyFrame> control_frame(
221 framer.CreateSynStream(1, // stream_id 220 framer.CreateSynStream(1, // stream_id
222 0, // associated_stream_id 221 0, // associated_stream_id
223 1, // priority 222 1, // priority
224 0, // credential_slot
225 CONTROL_FLAG_NONE, 223 CONTROL_FLAG_NONE,
226 &headers)); 224 &headers));
227 EXPECT_TRUE(control_frame.get() != NULL); 225 EXPECT_TRUE(control_frame.get() != NULL);
228 226
229 TestBufferedSpdyVisitor visitor(spdy_version()); 227 TestBufferedSpdyVisitor visitor(spdy_version());
230 visitor.SimulateInFramer( 228 visitor.SimulateInFramer(
231 reinterpret_cast<unsigned char*>(control_frame.get()->data()), 229 reinterpret_cast<unsigned char*>(control_frame.get()->data()),
232 control_frame.get()->size()); 230 control_frame.get()->size());
233 EXPECT_EQ(0, visitor.error_count_); 231 EXPECT_EQ(0, visitor.error_count_);
234 EXPECT_EQ(1, visitor.syn_frame_count_); 232 EXPECT_EQ(1, visitor.syn_frame_count_);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 reinterpret_cast<unsigned char*>(control_frame.get()->data()), 278 reinterpret_cast<unsigned char*>(control_frame.get()->data()),
281 control_frame.get()->size()); 279 control_frame.get()->size());
282 EXPECT_EQ(0, visitor.error_count_); 280 EXPECT_EQ(0, visitor.error_count_);
283 EXPECT_EQ(0, visitor.syn_frame_count_); 281 EXPECT_EQ(0, visitor.syn_frame_count_);
284 EXPECT_EQ(0, visitor.syn_reply_frame_count_); 282 EXPECT_EQ(0, visitor.syn_reply_frame_count_);
285 EXPECT_EQ(1, visitor.headers_frame_count_); 283 EXPECT_EQ(1, visitor.headers_frame_count_);
286 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); 284 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_));
287 } 285 }
288 286
289 } // namespace net 287 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/buffered_spdy_framer.cc ('k') | net/spdy/mock_spdy_framer_visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698