Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / shell / renderer / test_runner / MockWebRTCPeerConnectionHandler.h
1 // Copyright 2013 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 CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCPEERCONNECTIONHANDLER_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCPEERCONNECTIONHANDLER_H_
7
8 #include "base/basictypes.h"
9 #include "content/shell/renderer/test_runner/TestCommon.h"
10 #include "content/shell/renderer/test_runner/WebTask.h"
11 #include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h"
12 #include "third_party/WebKit/public/platform/WebRTCSessionDescription.h"
13 #include "third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h"
14 #include "third_party/WebKit/public/platform/WebRTCStatsRequest.h"
15
16 namespace blink {
17 class WebRTCPeerConnectionHandlerClient;
18 };
19
20 namespace content {
21
22 class TestInterfaces;
23
24 class MockWebRTCPeerConnectionHandler : public blink::WebRTCPeerConnectionHandler {
25 public:
26     MockWebRTCPeerConnectionHandler(blink::WebRTCPeerConnectionHandlerClient*, TestInterfaces*);
27
28     virtual bool initialize(const blink::WebRTCConfiguration&, const blink::WebMediaConstraints&) OVERRIDE;
29
30     virtual void createOffer(const blink::WebRTCSessionDescriptionRequest&, const blink::WebMediaConstraints&) OVERRIDE;
31     virtual void createAnswer(const blink::WebRTCSessionDescriptionRequest&, const blink::WebMediaConstraints&) OVERRIDE;
32     virtual void setLocalDescription(const blink::WebRTCVoidRequest&, const blink::WebRTCSessionDescription&) OVERRIDE;
33     virtual void setRemoteDescription(const blink::WebRTCVoidRequest&, const blink::WebRTCSessionDescription&) OVERRIDE;
34     virtual blink::WebRTCSessionDescription localDescription() OVERRIDE;
35     virtual blink::WebRTCSessionDescription remoteDescription() OVERRIDE;
36     virtual bool updateICE(const blink::WebRTCConfiguration&, const blink::WebMediaConstraints&) OVERRIDE;
37     virtual bool addICECandidate(const blink::WebRTCICECandidate&) OVERRIDE;
38     virtual bool addICECandidate(const blink::WebRTCVoidRequest&, const blink::WebRTCICECandidate&) OVERRIDE;
39     virtual bool addStream(const blink::WebMediaStream&, const blink::WebMediaConstraints&) OVERRIDE;
40     virtual void removeStream(const blink::WebMediaStream&) OVERRIDE;
41     virtual void getStats(const blink::WebRTCStatsRequest&) OVERRIDE;
42     virtual blink::WebRTCDataChannelHandler* createDataChannel(const blink::WebString& label, const blink::WebRTCDataChannelInit&) OVERRIDE;
43     virtual blink::WebRTCDTMFSenderHandler* createDTMFSender(const blink::WebMediaStreamTrack&) OVERRIDE;
44     virtual void stop() OVERRIDE;
45
46     // WebTask related methods
47     WebTaskList* taskList() { return &m_taskList; }
48
49 private:
50     MockWebRTCPeerConnectionHandler();
51
52     blink::WebRTCPeerConnectionHandlerClient* m_client;
53     bool m_stopped;
54     WebTaskList m_taskList;
55     blink::WebRTCSessionDescription m_localDescription;
56     blink::WebRTCSessionDescription m_remoteDescription;
57     int m_streamCount;
58     TestInterfaces* m_interfaces;
59
60     DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandler);
61 };
62
63 }  // namespace content
64
65 #endif  // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCPEERCONNECTIONHANDLER_H_