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

Side by Side Diff: webrtc/api/test/peerconnectiontestwrapper.h

Issue 1860423002: Changed PeerConnectionEndToEndTest to use a separate worker thread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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
1 /* 1 /*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ 11 #ifndef WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_
12 #define WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ 12 #define WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_
13 13
14 #include "webrtc/api/peerconnectioninterface.h" 14 #include "webrtc/api/peerconnectioninterface.h"
15 #include "webrtc/api/test/fakeaudiocapturemodule.h" 15 #include "webrtc/api/test/fakeaudiocapturemodule.h"
16 #include "webrtc/api/test/fakeconstraints.h" 16 #include "webrtc/api/test/fakeconstraints.h"
17 #include "webrtc/api/test/fakevideotrackrenderer.h" 17 #include "webrtc/api/test/fakevideotrackrenderer.h"
18 #include "webrtc/base/sigslot.h" 18 #include "webrtc/base/sigslot.h"
19 19
20 class PeerConnectionTestWrapper 20 class PeerConnectionTestWrapper
21 : public webrtc::PeerConnectionObserver, 21 : public webrtc::PeerConnectionObserver,
22 public webrtc::CreateSessionDescriptionObserver, 22 public webrtc::CreateSessionDescriptionObserver,
23 public sigslot::has_slots<> { 23 public sigslot::has_slots<> {
24 public: 24 public:
25 static void Connect(PeerConnectionTestWrapper* caller, 25 static void Connect(PeerConnectionTestWrapper* caller,
26 PeerConnectionTestWrapper* callee); 26 PeerConnectionTestWrapper* callee);
27 27
28 explicit PeerConnectionTestWrapper(const std::string& name); 28 explicit PeerConnectionTestWrapper(const std::string& name,
29 rtc::Thread* worker_thread);
29 virtual ~PeerConnectionTestWrapper(); 30 virtual ~PeerConnectionTestWrapper();
30 31
31 bool CreatePc(const webrtc::MediaConstraintsInterface* constraints); 32 bool CreatePc(const webrtc::MediaConstraintsInterface* constraints);
32 33
33 rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel( 34 rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel(
34 const std::string& label, 35 const std::string& label,
35 const webrtc::DataChannelInit& init); 36 const webrtc::DataChannelInit& init);
36 37
37 // Implements PeerConnectionObserver. 38 // Implements PeerConnectionObserver.
38 virtual void OnSignalingChange( 39 virtual void OnSignalingChange(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void SetLocalDescription(const std::string& type, const std::string& sdp); 82 void SetLocalDescription(const std::string& type, const std::string& sdp);
82 void SetRemoteDescription(const std::string& type, const std::string& sdp); 83 void SetRemoteDescription(const std::string& type, const std::string& sdp);
83 bool CheckForConnection(); 84 bool CheckForConnection();
84 bool CheckForAudio(); 85 bool CheckForAudio();
85 bool CheckForVideo(); 86 bool CheckForVideo();
86 rtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia( 87 rtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia(
87 bool audio, const webrtc::FakeConstraints& audio_constraints, 88 bool audio, const webrtc::FakeConstraints& audio_constraints,
88 bool video, const webrtc::FakeConstraints& video_constraints); 89 bool video, const webrtc::FakeConstraints& video_constraints);
89 90
90 std::string name_; 91 std::string name_;
92 rtc::Thread* worker_thread_;
91 rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; 93 rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
92 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> 94 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
93 peer_connection_factory_; 95 peer_connection_factory_;
94 rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_; 96 rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
95 rtc::scoped_ptr<webrtc::FakeVideoTrackRenderer> renderer_; 97 rtc::scoped_ptr<webrtc::FakeVideoTrackRenderer> renderer_;
96 }; 98 };
97 99
98 #endif // WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_ 100 #endif // WEBRTC_API_TEST_PEERCONNECTIONTESTWRAPPER_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectionendtoend_unittest.cc ('k') | webrtc/api/test/peerconnectiontestwrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698