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.
5 #ifndef NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_
6 #define NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_
8 #include "base/strings/string_piece.h"
9 #include "net/spdy/spdy_framer.h"
10 #include "testing/gmock/include/gmock/gmock.h"
16 class MockSpdyFramerVisitor
: public SpdyFramerVisitorInterface
{
18 MockSpdyFramerVisitor();
19 virtual ~MockSpdyFramerVisitor();
20 MOCK_METHOD1(OnError
, void(SpdyFramer
* framer
));
21 MOCK_METHOD3(OnDataFrameHeader
, void(SpdyStreamId stream_id
,
24 MOCK_METHOD4(OnStreamFrameData
, void(SpdyStreamId stream_id
,
28 MOCK_METHOD2(OnStreamPadding
, void(SpdyStreamId stream_id
, size_t len
));
29 MOCK_METHOD3(OnControlFrameHeaderData
, bool(SpdyStreamId stream_id
,
30 const char* header_data
,
32 MOCK_METHOD5(OnSynStream
, void(SpdyStreamId stream_id
,
33 SpdyStreamId associated_stream_id
,
34 SpdyPriority priority
,
36 bool unidirectional
));
37 MOCK_METHOD2(OnSynReply
, void(SpdyStreamId stream_id
, bool fin
));
38 MOCK_METHOD2(OnRstStream
, void(SpdyStreamId stream_id
,
39 SpdyRstStreamStatus status
));
40 MOCK_METHOD1(OnSettings
, void(bool clear_persisted
));
41 MOCK_METHOD3(OnSetting
, void(SpdySettingsIds id
, uint8 flags
, uint32 value
));
42 MOCK_METHOD2(OnPing
, void(SpdyPingId unique_id
, bool is_ack
));
43 MOCK_METHOD0(OnSettingsEnd
, void());
44 MOCK_METHOD2(OnGoAway
, void(SpdyStreamId last_accepted_stream_id
,
45 SpdyGoAwayStatus status
));
46 MOCK_METHOD7(OnHeaders
,
47 void(SpdyStreamId stream_id
,
49 SpdyPriority priority
,
50 SpdyStreamId parent_stream_id
,
54 MOCK_METHOD2(OnWindowUpdate
,
55 void(SpdyStreamId stream_id
, int delta_window_size
));
56 MOCK_METHOD1(OnBlocked
, void(SpdyStreamId stream_id
));
57 MOCK_METHOD3(OnPushPromise
, void(SpdyStreamId stream_id
,
58 SpdyStreamId promised_stream_id
,
60 MOCK_METHOD2(OnContinuation
, void(SpdyStreamId stream_id
, bool end
));
61 MOCK_METHOD3(OnAltSvc
,
62 void(SpdyStreamId stream_id
,
63 base::StringPiece origin
,
64 const SpdyAltSvcWireFormat::AlternativeServiceVector
&
66 MOCK_METHOD4(OnPriority
,
67 void(SpdyStreamId stream_id
,
68 SpdyStreamId parent_stream_id
,
71 MOCK_METHOD2(OnUnknownFrame
, bool(SpdyStreamId stream_id
, int frame_type
));
78 #endif // NET_SPDY_MOCK_SPDY_FRAMER_VISITOR_H_