| 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_stream_test_util.h" | 5 #include "net/spdy/spdy_stream_test_util.h" |
| 6 | 6 |
| 7 #include "net/base/completion_callback.h" | 7 #include "net/base/completion_callback.h" |
| 8 #include "net/spdy/spdy_stream.h" | 8 #include "net/spdy/spdy_stream.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 EXPECT_TRUE(send_headers_completed_); | 48 EXPECT_TRUE(send_headers_completed_); |
| 49 *response_ = response; | 49 *response_ = response; |
| 50 if (buf_) { | 50 if (buf_) { |
| 51 EXPECT_EQ(ERR_IO_PENDING, | 51 EXPECT_EQ(ERR_IO_PENDING, |
| 52 stream_->WriteStreamData(buf_.get(), buf_->size(), | 52 stream_->WriteStreamData(buf_.get(), buf_->size(), |
| 53 DATA_FLAG_NONE)); | 53 DATA_FLAG_NONE)); |
| 54 } | 54 } |
| 55 return status; | 55 return status; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void TestSpdyStreamDelegate::OnDataReceived(const char* buffer, int bytes) { | 58 int TestSpdyStreamDelegate::OnDataReceived(const char* buffer, int bytes) { |
| 59 received_data_ += std::string(buffer, bytes); | 59 received_data_ += std::string(buffer, bytes); |
| 60 return OK; |
| 60 } | 61 } |
| 61 | 62 |
| 62 void TestSpdyStreamDelegate::OnDataSent(int length) { | 63 void TestSpdyStreamDelegate::OnDataSent(int length) { |
| 63 data_sent_ += length; | 64 data_sent_ += length; |
| 64 } | 65 } |
| 65 | 66 |
| 66 void TestSpdyStreamDelegate::OnClose(int status) { | 67 void TestSpdyStreamDelegate::OnClose(int status) { |
| 67 closed_ = true; | 68 closed_ = true; |
| 68 CompletionCallback callback = callback_; | 69 CompletionCallback callback = callback_; |
| 69 callback_.Reset(); | 70 callback_.Reset(); |
| 70 callback.Run(OK); | 71 callback.Run(OK); |
| 71 } | 72 } |
| 72 | 73 |
| 73 } // namespace test | 74 } // namespace test |
| 74 | 75 |
| 75 } // namespace net | 76 } // namespace net |
| OLD | NEW |