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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 int TestSpdyStreamDelegate::OnResponseReceived(const SpdyHeaderBlock& response, | 48 int TestSpdyStreamDelegate::OnResponseReceived(const SpdyHeaderBlock& response, |
49 base::Time response_time, | 49 base::Time response_time, |
50 int status) { | 50 int status) { |
51 EXPECT_TRUE(send_headers_completed_); | 51 EXPECT_TRUE(send_headers_completed_); |
52 *response_ = response; | 52 *response_ = response; |
53 if (headers_.get()) { | 53 if (headers_.get()) { |
54 EXPECT_EQ(ERR_IO_PENDING, | 54 EXPECT_EQ(ERR_IO_PENDING, |
55 stream_->WriteHeaders(headers_.release())); | 55 stream_->WriteHeaders(headers_.release())); |
56 } | 56 } |
57 if (buf_) { | 57 if (buf_.get()) { |
58 EXPECT_EQ(ERR_IO_PENDING, | 58 EXPECT_EQ(ERR_IO_PENDING, |
59 stream_->WriteStreamData(buf_.get(), buf_->size(), | 59 stream_->WriteStreamData(buf_.get(), buf_->size(), |
60 DATA_FLAG_NONE)); | 60 DATA_FLAG_NONE)); |
61 } | 61 } |
62 return status; | 62 return status; |
63 } | 63 } |
64 | 64 |
65 void TestSpdyStreamDelegate::OnHeadersSent() { | 65 void TestSpdyStreamDelegate::OnHeadersSent() { |
66 headers_sent_++; | 66 headers_sent_++; |
67 } | 67 } |
(...skipping 10 matching lines...) Expand all Loading... |
78 void TestSpdyStreamDelegate::OnClose(int status) { | 78 void TestSpdyStreamDelegate::OnClose(int status) { |
79 closed_ = true; | 79 closed_ = true; |
80 CompletionCallback callback = callback_; | 80 CompletionCallback callback = callback_; |
81 callback_.Reset(); | 81 callback_.Reset(); |
82 callback.Run(OK); | 82 callback.Run(OK); |
83 } | 83 } |
84 | 84 |
85 } // namespace test | 85 } // namespace test |
86 | 86 |
87 } // namespace net | 87 } // namespace net |
OLD | NEW |