| 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/spdy_framer.h" | 5 #include "net/spdy/spdy_framer.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 bool fin) override { | 291 bool fin) override { |
| 292 ++data_frame_count_; | 292 ++data_frame_count_; |
| 293 header_stream_id_ = stream_id; | 293 header_stream_id_ = stream_id; |
| 294 } | 294 } |
| 295 | 295 |
| 296 void OnStreamFrameData(SpdyStreamId stream_id, | 296 void OnStreamFrameData(SpdyStreamId stream_id, |
| 297 const char* data, | 297 const char* data, |
| 298 size_t len, | 298 size_t len, |
| 299 bool fin) override { | 299 bool fin) override { |
| 300 EXPECT_EQ(header_stream_id_, stream_id); | 300 EXPECT_EQ(header_stream_id_, stream_id); |
| 301 if (len == 0) | 301 if (len == 0) { |
| 302 ++zero_length_data_frame_count_; | 302 ++zero_length_data_frame_count_; |
| 303 } |
| 303 | 304 |
| 304 data_bytes_ += len; | 305 data_bytes_ += len; |
| 305 LOG(INFO) << "OnStreamFrameData(" << stream_id << ", \""; | 306 LOG(INFO) << "OnStreamFrameData(" << stream_id << ", \""; |
| 306 if (len > 0) { | 307 if (len > 0) { |
| 307 for (size_t i = 0 ; i < len; ++i) { | 308 for (size_t i = 0 ; i < len; ++i) { |
| 308 LOG(INFO) << std::hex << (0xFF & static_cast<unsigned int>(data[i])) | 309 LOG(INFO) << std::hex << (0xFF & static_cast<unsigned int>(data[i])) |
| 309 << std::dec; | 310 << std::dec; |
| 310 } | 311 } |
| 311 } | 312 } |
| 312 LOG(INFO) << "\", " << len << ")\n"; | 313 LOG(INFO) << "\", " << len << ")\n"; |
| (...skipping 5828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6141 | 6142 |
| 6142 EXPECT_EQ(1, visitor->data_frame_count_); | 6143 EXPECT_EQ(1, visitor->data_frame_count_); |
| 6143 EXPECT_EQ(strlen(four_score), static_cast<unsigned>(visitor->data_bytes_)); | 6144 EXPECT_EQ(strlen(four_score), static_cast<unsigned>(visitor->data_bytes_)); |
| 6144 EXPECT_EQ(0, visitor->headers_frame_count_); | 6145 EXPECT_EQ(0, visitor->headers_frame_count_); |
| 6145 } | 6146 } |
| 6146 } | 6147 } |
| 6147 | 6148 |
| 6148 } // namespace test | 6149 } // namespace test |
| 6149 | 6150 |
| 6150 } // namespace net | 6151 } // namespace net |
| OLD | NEW |