| Index: net/spdy/spdy_stream_test_util.cc
|
| diff --git a/net/spdy/spdy_stream_test_util.cc b/net/spdy/spdy_stream_test_util.cc
|
| index 0165c2046aa42c78568d5eb96164ffeb1886fe4e..4af3382228e2e389eff6f5eeb5239dd94be9de5a 100644
|
| --- a/net/spdy/spdy_stream_test_util.cc
|
| +++ b/net/spdy/spdy_stream_test_util.cc
|
| @@ -4,6 +4,9 @@
|
|
|
| #include "net/spdy/spdy_stream_test_util.h"
|
|
|
| +#include <cstddef>
|
| +
|
| +#include "base/stl_util.h"
|
| #include "net/base/completion_callback.h"
|
| #include "net/spdy/spdy_stream.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -78,10 +81,8 @@ void StreamDelegateBase::OnHeadersSent() {
|
| }
|
|
|
| int StreamDelegateBase::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) {
|
| - if (buffer) {
|
| - received_data_ += std::string(buffer->GetRemainingData(),
|
| - buffer->GetRemainingSize());
|
| - }
|
| + if (buffer)
|
| + received_data_queue_.Enqueue(buffer.Pass());
|
| return OK;
|
| }
|
|
|
| @@ -102,6 +103,17 @@ int StreamDelegateBase::WaitForClose() {
|
| return result;
|
| }
|
|
|
| +std::string StreamDelegateBase::TakeReceivedData() {
|
| + size_t len = received_data_queue_.GetTotalSize();
|
| + std::string received_data(len, '\0');
|
| + if (len > 0) {
|
| + EXPECT_EQ(
|
| + len,
|
| + received_data_queue_.Dequeue(string_as_array(&received_data), len));
|
| + }
|
| + return received_data;
|
| +}
|
| +
|
| std::string StreamDelegateBase::GetResponseHeaderValue(
|
| const std::string& name) const {
|
| SpdyHeaderBlock::const_iterator it = response_.find(name);
|
|
|