mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1144432 - Part 4: Unbust signaling_unittests r=mt
This commit is contained in:
parent
bc0089cbcc
commit
65249960e6
@ -210,13 +210,18 @@ PeerConnectionMedia::PeerConnectionMedia(PeerConnectionImpl *parent)
|
||||
mMainThread(mParent->GetMainThread()),
|
||||
mSTSThread(mParent->GetSTSThread()),
|
||||
mProxyResolveCompleted(false) {
|
||||
}
|
||||
|
||||
nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_servers,
|
||||
const std::vector<NrIceTurnServer>& turn_servers)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsCOMPtr<nsIProtocolProxyService> pps =
|
||||
do_GetService(NS_PROTOCOLPROXYSERVICE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
CSFLogError(logTag, "%s: Failed to get proxy service: %d", __FUNCTION__, (int)rv);
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// We use the following URL to find the "default" proxy address for all HTTPS
|
||||
@ -226,21 +231,42 @@ PeerConnectionMedia::PeerConnectionMedia(PeerConnectionImpl *parent)
|
||||
rv = NS_NewURI(getter_AddRefs(fakeHttpsLocation), "https://example.com");
|
||||
if (NS_FAILED(rv)) {
|
||||
CSFLogError(logTag, "%s: Failed to set URI: %d", __FUNCTION__, (int)rv);
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
nsCOMPtr<nsIDocument> doc = mParent->GetWindow()->GetExtantDoc();
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
nsCOMPtr<nsIDocument> principal = mParent->GetWindow()->GetExtantDoc();
|
||||
#else
|
||||
// For unit-tests
|
||||
nsCOMPtr<nsIScriptSecurityManager> secMan(
|
||||
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv)) {
|
||||
CSFLogError(logTag, "%s: Failed to get IOService: %d",
|
||||
__FUNCTION__, (int)rv);
|
||||
CSFLogError(logTag, "%s: Failed to get securityManager: %d", __FUNCTION__, (int)rv);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
rv = secMan->GetSystemPrincipal(getter_AddRefs(principal));
|
||||
if (NS_FAILED(rv)) {
|
||||
CSFLogError(logTag, "%s: Failed to get systemPrincipal: %d", __FUNCTION__, (int)rv);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
rv = NS_NewChannel(getter_AddRefs(channel),
|
||||
fakeHttpsLocation,
|
||||
doc,
|
||||
principal,
|
||||
nsILoadInfo::SEC_NORMAL,
|
||||
nsIContentPolicy::TYPE_OTHER);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
CSFLogError(logTag, "%s: Failed to get channel from URI: %d",
|
||||
__FUNCTION__, (int)rv);
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsRefPtr<ProtocolProxyQueryHandler> handler = new ProtocolProxyQueryHandler(this);
|
||||
@ -250,13 +276,9 @@ PeerConnectionMedia::PeerConnectionMedia(PeerConnectionImpl *parent)
|
||||
handler, getter_AddRefs(mProxyRequest));
|
||||
if (NS_FAILED(rv)) {
|
||||
CSFLogError(logTag, "%s: Failed to resolve protocol proxy: %d", __FUNCTION__, (int)rv);
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_servers,
|
||||
const std::vector<NrIceTurnServer>& turn_servers)
|
||||
{
|
||||
// TODO(ekr@rtfm.com): need some way to set not offerer later
|
||||
// Looks like a bug in the NrIceCtx API.
|
||||
mIceCtx = NrIceCtx::Create("PC:" + mParentName,
|
||||
@ -267,7 +289,7 @@ nsresult PeerConnectionMedia::Init(const std::vector<NrIceStunServer>& stun_serv
|
||||
CSFLogError(logTag, "%s: Failed to create Ice Context", __FUNCTION__);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsresult rv;
|
||||
|
||||
if (NS_FAILED(rv = mIceCtx->SetStunServers(stun_servers))) {
|
||||
CSFLogError(logTag, "%s: Failed to set stun servers", __FUNCTION__);
|
||||
return rv;
|
||||
|
@ -2313,14 +2313,6 @@ TEST_P(SignalingTest, OfferAnswerVideoInactive)
|
||||
CloseStreams();
|
||||
}
|
||||
|
||||
TEST_P(SignalingTest, OfferAnswerBothInactive)
|
||||
{
|
||||
OfferOptions options;
|
||||
options.setInt32Option("OfferToReceiveAudio", 1);
|
||||
options.setInt32Option("OfferToReceiveVideo", 1);
|
||||
OfferAnswer(options, OFFER_NONE);
|
||||
}
|
||||
|
||||
TEST_P(SignalingTest, CreateOfferAddCandidate)
|
||||
{
|
||||
OfferOptions options;
|
||||
|
Loading…
Reference in New Issue
Block a user