mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-14 14:20:45 +01:00

This is a reland of ad5c4accad
It was flaky due to starting ICE signaling before SDP negotiation
finished. This was solved by adding an helper for adding ice candidates
which will wait until the peer connection is ready if needed.
Original change's description:
> Adds PeerConnection scenario test framework.
>
> Bug: webrtc:10839
> Change-Id: If67eeb680d016d66c69d8e761a88c240e4931a5d
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147276
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Reviewed-by: Erik Språng <sprang@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#28754}
Bug: webrtc:10839
Change-Id: I6eb8f482561c87e7b0f20d2431d21a41b26c91d5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147877
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28777}
43 lines
1.7 KiB
C++
43 lines
1.7 KiB
C++
/*
|
|
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#ifndef TEST_PEER_SCENARIO_SDP_CALLBACKS_H_
|
|
#define TEST_PEER_SCENARIO_SDP_CALLBACKS_H_
|
|
|
|
#include "api/peer_connection_interface.h"
|
|
|
|
// Helpers to allow usage of std::function/lambdas to observe SDP operation in
|
|
// the peer conenction API. As they only have handlers for sucess, failures will
|
|
// cause a crash.
|
|
|
|
namespace webrtc {
|
|
namespace test {
|
|
namespace webrtc_sdp_obs_impl {
|
|
class SdpSetObserversInterface : public SetSessionDescriptionObserver,
|
|
public SetRemoteDescriptionObserverInterface {
|
|
};
|
|
} // namespace webrtc_sdp_obs_impl
|
|
|
|
// Implementation of both SetSessionDescriptionObserver and
|
|
// SetRemoteDescriptionObserverInterface for use with SDP set operations. This
|
|
// return a raw owning pointer as it's only intended to be used as input to
|
|
// PeerConnection API which will take ownership.
|
|
webrtc_sdp_obs_impl::SdpSetObserversInterface* SdpSetObserver(
|
|
std::function<void()> callback);
|
|
|
|
// Implementation of CreateSessionDescriptionObserver for use with SDP create
|
|
// operations. This return a raw owning pointer as it's only intended to be used
|
|
// as input to PeerConnection API which will take ownership.
|
|
CreateSessionDescriptionObserver* SdpCreateObserver(
|
|
std::function<void(SessionDescriptionInterface*)> callback);
|
|
|
|
} // namespace test
|
|
} // namespace webrtc
|
|
|
|
#endif // TEST_PEER_SCENARIO_SDP_CALLBACKS_H_
|