mock_spdy_framer_visitor.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
1// Copyright 2014 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.
4
5#ifndef NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_
6#define NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_
7
8#include "net/spdy/spdy_framer.h"
9#include "testing/gmock/include/gmock/gmock.h"
10
11namespace net {
12
13namespace test {
14
15class MockSpdyFramerVisitor : public SpdyFramerVisitorInterface {
16 public:
17  MockSpdyFramerVisitor();
18  virtual ~MockSpdyFramerVisitor();
19  MOCK_METHOD1(OnError, void(SpdyFramer* framer));
20  MOCK_METHOD3(OnDataFrameHeader, void(SpdyStreamId stream_id,
21                                       size_t length,
22                                       bool fin));
23  MOCK_METHOD4(OnStreamFrameData, void(SpdyStreamId stream_id,
24                                       const char* data,
25                                       size_t len,
26                                       bool fin));
27  MOCK_METHOD3(OnControlFrameHeaderData, bool(SpdyStreamId stream_id,
28                                              const char* header_data,
29                                              size_t len));
30  MOCK_METHOD5(OnSynStream, void(SpdyStreamId stream_id,
31                                 SpdyStreamId associated_stream_id,
32                                 SpdyPriority priority,
33                                 bool fin,
34                                 bool unidirectional));
35  MOCK_METHOD2(OnSynReply, void(SpdyStreamId stream_id, bool fin));
36  MOCK_METHOD2(OnRstStream, void(SpdyStreamId stream_id,
37                                 SpdyRstStreamStatus status));
38  MOCK_METHOD1(OnSettings, void(bool clear_persisted));
39  MOCK_METHOD3(OnSetting, void(SpdySettingsIds id, uint8 flags, uint32 value));
40  MOCK_METHOD2(OnPing, void(SpdyPingId unique_id, bool is_ack));
41  MOCK_METHOD0(OnSettingsEnd, void());
42  MOCK_METHOD2(OnGoAway, void(SpdyStreamId last_accepted_stream_id,
43                              SpdyGoAwayStatus status));
44  MOCK_METHOD3(OnHeaders, void(SpdyStreamId stream_id, bool fin, bool end));
45  MOCK_METHOD2(OnWindowUpdate, void(SpdyStreamId stream_id,
46                                    uint32 delta_window_size));
47  MOCK_METHOD1(OnBlocked, void(SpdyStreamId stream_id));
48  MOCK_METHOD3(OnPushPromise, void(SpdyStreamId stream_id,
49                                   SpdyStreamId promised_stream_id,
50                                   bool end));
51  MOCK_METHOD2(OnContinuation, void(SpdyStreamId stream_id, bool end));
52};
53
54}  // namespace test
55
56}  // namespace net
57
58#endif  // NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_
59