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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 int StreamDelegateBase::WaitForClose() { | 95 int StreamDelegateBase::WaitForClose() { |
96 int result = callback_.WaitForResult(); | 96 int result = callback_.WaitForResult(); |
97 EXPECT_TRUE(!stream_.get()); | 97 EXPECT_TRUE(!stream_.get()); |
98 return result; | 98 return result; |
99 } | 99 } |
100 | 100 |
101 std::string StreamDelegateBase::GetResponseHeaderValue( | 101 std::string StreamDelegateBase::GetResponseHeaderValue( |
102 const std::string& name) const { | 102 const std::string& name) const { |
103 SpdyHeaderBlock::const_iterator it = response_.find(name); | 103 SpdyHeaderBlock::const_iterator it = response_.find(name); |
104 return (it == response_.end()) ? "" : it->second; | 104 return (it == response_.end()) ? std::string() : it->second; |
105 } | 105 } |
106 | 106 |
107 StreamDelegateSendImmediate::StreamDelegateSendImmediate( | 107 StreamDelegateSendImmediate::StreamDelegateSendImmediate( |
108 const scoped_refptr<SpdyStream>& stream, | 108 const scoped_refptr<SpdyStream>& stream, |
109 scoped_ptr<SpdyHeaderBlock> headers, | 109 scoped_ptr<SpdyHeaderBlock> headers, |
110 base::StringPiece data) | 110 base::StringPiece data) |
111 : StreamDelegateBase(stream), | 111 : StreamDelegateBase(stream), |
112 headers_(headers.Pass()), | 112 headers_(headers.Pass()), |
113 data_(data) {} | 113 data_(data) {} |
114 | 114 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 174 } |
175 | 175 |
176 // Check if the entire body data has been sent. | 176 // Check if the entire body data has been sent. |
177 *eof = (buf_->BytesRemaining() == 0); | 177 *eof = (buf_->BytesRemaining() == 0); |
178 return status; | 178 return status; |
179 } | 179 } |
180 | 180 |
181 } // namespace test | 181 } // namespace test |
182 | 182 |
183 } // namespace net | 183 } // namespace net |
OLD | NEW |