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/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 { |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { | 14 class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface { |
15 public: | 15 public: |
16 explicit TestBufferedSpdyVisitor(SpdyMajorVersion spdy_version) | 16 explicit TestBufferedSpdyVisitor(SpdyMajorVersion spdy_version) |
17 : buffered_spdy_framer_(spdy_version, true), | 17 : buffered_spdy_framer_(spdy_version, true), |
18 error_count_(0), | 18 error_count_(0), |
19 setting_count_(0), | 19 setting_count_(0), |
20 syn_frame_count_(0), | 20 syn_frame_count_(0), |
21 syn_reply_frame_count_(0), | 21 syn_reply_frame_count_(0), |
22 headers_frame_count_(0), | 22 headers_frame_count_(0), |
23 header_stream_id_(-1) { | 23 header_stream_id_(-1) { |
24 } | 24 } |
25 | 25 |
26 virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE { | 26 virtual void OnError(SpdyFramer::SpdyError error_code) OVERRIDE { |
27 LOG(INFO) << "SpdyFramer Error: " << error_code; | 27 VLOG(0) << "SpdyFramer Error: " << error_code; |
28 error_count_++; | 28 error_count_++; |
29 } | 29 } |
30 | 30 |
31 virtual void OnStreamError( | 31 virtual void OnStreamError( |
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 VLOG(0) << "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, | 42 uint8 credential_slot, |
43 bool fin, | 43 bool fin, |
44 bool unidirectional, | 44 bool unidirectional, |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 reinterpret_cast<unsigned char*>(control_frame.get()->data()), | 275 reinterpret_cast<unsigned char*>(control_frame.get()->data()), |
276 control_frame.get()->size()); | 276 control_frame.get()->size()); |
277 EXPECT_EQ(0, visitor.error_count_); | 277 EXPECT_EQ(0, visitor.error_count_); |
278 EXPECT_EQ(0, visitor.syn_frame_count_); | 278 EXPECT_EQ(0, visitor.syn_frame_count_); |
279 EXPECT_EQ(0, visitor.syn_reply_frame_count_); | 279 EXPECT_EQ(0, visitor.syn_reply_frame_count_); |
280 EXPECT_EQ(1, visitor.headers_frame_count_); | 280 EXPECT_EQ(1, visitor.headers_frame_count_); |
281 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); | 281 EXPECT_TRUE(CompareHeaderBlocks(&headers, &visitor.headers_)); |
282 } | 282 } |
283 | 283 |
284 } // namespace net | 284 } // namespace net |
OLD | NEW |