Revert "Merged all Chromoting Host code into remoting_core.dll (Windows)."
[chromium-blink-merge.git] / net / spdy / spdy_stream_test_util.h
blob605901493bebb2740a74f693c56fc74178046fea
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
3 // found in the LICENSE file.
5 #ifndef NET_SPDY_SPDY_STREAM_TEST_UTIL_H_
6 #define NET_SPDY_SPDY_STREAM_TEST_UTIL_H_
8 #include "base/memory/linked_ptr.h"
9 #include "base/memory/ref_counted.h"
10 #include "net/base/completion_callback.h"
11 #include "net/spdy/spdy_stream.h"
13 namespace net {
15 namespace test {
17 class TestSpdyStreamDelegate : public SpdyStream::Delegate {
18 public:
19 TestSpdyStreamDelegate(SpdyStream* stream,
20 SpdyHeaderBlock* headers,
21 IOBufferWithSize* buf,
22 const CompletionCallback& callback);
23 virtual ~TestSpdyStreamDelegate();
25 virtual bool OnSendHeadersComplete(int status) OVERRIDE;
26 virtual int OnSendBody() OVERRIDE;
27 virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE;
28 virtual int OnResponseReceived(const SpdyHeaderBlock& response,
29 base::Time response_time,
30 int status) OVERRIDE;
31 virtual void OnHeadersSent() OVERRIDE;
32 virtual int OnDataReceived(const char* buffer, int bytes) OVERRIDE;
33 virtual void OnDataSent(int length) OVERRIDE;
34 virtual void OnClose(int status) OVERRIDE;
36 bool send_headers_completed() const { return send_headers_completed_; }
37 const linked_ptr<SpdyHeaderBlock>& response() const {
38 return response_;
40 const std::string& received_data() const { return received_data_; }
41 int headers_sent() const { return headers_sent_; }
42 int data_sent() const { return data_sent_; }
43 bool closed() const { return closed_; }
45 private:
46 SpdyStream* stream_;
47 scoped_ptr<SpdyHeaderBlock> headers_;
48 scoped_refptr<IOBufferWithSize> buf_;
49 CompletionCallback callback_;
50 bool send_headers_completed_;
51 linked_ptr<SpdyHeaderBlock> response_;
52 std::string received_data_;
53 int headers_sent_;
54 int data_sent_;
55 bool closed_;
59 } // namespace test
61 } // namespace net
63 #endif // NET_SPDY_SPDY_STREAM_TEST_UTIL_H_