Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: content/shell/renderer/test_runner/mock_webrtc_peer_connection_handler.h

Issue 316093005: test_runner: Migrate MockWebRTCPeerConnectionHandler to Chromium C++ style (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
25 : public blink::WebRTCPeerConnectionHandler {
26 public:
27 MockWebRTCPeerConnectionHandler(
28 blink::WebRTCPeerConnectionHandlerClient* client,
29 TestInterfaces* interfaces);
30
31 // WebRTCPeerConnectionHandler related methods
32 virtual bool initialize(
33 const blink::WebRTCConfiguration& configuration,
34 const blink::WebMediaConstraints& constraints) OVERRIDE;
35
36 virtual void createOffer(
37 const blink::WebRTCSessionDescriptionRequest& request,
38 const blink::WebMediaConstraints& constraints) OVERRIDE;
39 virtual void createAnswer(
40 const blink::WebRTCSessionDescriptionRequest& request,
41 const blink::WebMediaConstraints& constraints) OVERRIDE;
42 virtual void setLocalDescription(
43 const blink::WebRTCVoidRequest& request,
44 const blink::WebRTCSessionDescription& local_description) OVERRIDE;
45 virtual void setRemoteDescription(
46 const blink::WebRTCVoidRequest& request,
47 const blink::WebRTCSessionDescription& remote_description) OVERRIDE;
48 virtual blink::WebRTCSessionDescription localDescription() OVERRIDE;
49 virtual blink::WebRTCSessionDescription remoteDescription() OVERRIDE;
50 virtual bool updateICE(
51 const blink::WebRTCConfiguration& configuration,
52 const blink::WebMediaConstraints& constraints) OVERRIDE;
53 virtual bool addICECandidate(
54 const blink::WebRTCICECandidate& ice_candidate) OVERRIDE;
55 virtual bool addICECandidate(
56 const blink::WebRTCVoidRequest& request,
57 const blink::WebRTCICECandidate& ice_candidate) OVERRIDE;
58 virtual bool addStream(
59 const blink::WebMediaStream& stream,
60 const blink::WebMediaConstraints& constraints) OVERRIDE;
61 virtual void removeStream(const blink::WebMediaStream& stream) OVERRIDE;
62 virtual void getStats(const blink::WebRTCStatsRequest& request) OVERRIDE;
63 virtual blink::WebRTCDataChannelHandler* createDataChannel(
64 const blink::WebString& label,
65 const blink::WebRTCDataChannelInit& init) OVERRIDE;
66 virtual blink::WebRTCDTMFSenderHandler* createDTMFSender(
67 const blink::WebMediaStreamTrack& track) OVERRIDE;
68 virtual void stop() OVERRIDE;
69
70 // WebTask related methods
71 WebTaskList* mutable_task_list() { return &task_list_; }
72
73 private:
74 MockWebRTCPeerConnectionHandler();
75
76 blink::WebRTCPeerConnectionHandlerClient* client_;
77 bool stopped_;
78 WebTaskList task_list_;
79 blink::WebRTCSessionDescription local_description_;
80 blink::WebRTCSessionDescription remote_description_;
81 int stream_count_;
82 TestInterfaces* interfaces_;
83
84 DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandler);
85 };
86
87 } // namespace content
88
89 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_MOCKWEBRTCPEERCONNECTIONHANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698