mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Bug 1091898 - remove webrtc-specific testing of webidl exceptions. r=jesup, r=drno
This commit is contained in:
parent
275a55cc97
commit
30a709ff3c
@ -83,8 +83,6 @@ skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
|
|||||||
skip-if = toolkit == 'gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
|
skip-if = toolkit == 'gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
|
||||||
[test_peerConnection_bug834153.html]
|
[test_peerConnection_bug834153.html]
|
||||||
skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
|
skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
|
||||||
[test_peerConnection_bug835370.html]
|
|
||||||
skip-if = toolkit == 'gonk' # b2g (Bug 1059867)
|
|
||||||
[test_peerConnection_bug1013809.html]
|
[test_peerConnection_bug1013809.html]
|
||||||
skip-if = toolkit == 'gonk' # b2g emulator seems to be too slow (Bug 1016498 and 1008080)
|
skip-if = toolkit == 'gonk' # b2g emulator seems to be too slow (Bug 1016498 and 1008080)
|
||||||
[test_peerConnection_bug1042791.html]
|
[test_peerConnection_bug1042791.html]
|
||||||
|
@ -1,53 +0,0 @@
|
|||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
||||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
||||||
<script type="application/javascript" src="head.js"></script>
|
|
||||||
<script type="application/javascript" src="pc.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<pre id="test">
|
|
||||||
<script type="application/javascript">
|
|
||||||
createHTML({
|
|
||||||
bug: "835370",
|
|
||||||
title: "PeerConnection.createOffer valid/invalid constraints permutations"
|
|
||||||
});
|
|
||||||
|
|
||||||
runNetworkTest(function () {
|
|
||||||
var pconnect = new mozRTCPeerConnection();
|
|
||||||
var pconnects = new mozRTCPeerConnection();
|
|
||||||
|
|
||||||
function step1(offer) {}
|
|
||||||
function failed(code) {}
|
|
||||||
|
|
||||||
var exception = null;
|
|
||||||
try { pconnects.createOffer(step1, failed); } catch (e) { exception = e; }
|
|
||||||
ok(!exception, "createOffer(step1, failed) succeeds");
|
|
||||||
exception = null;
|
|
||||||
try { pconnect.createOffer(step1, failed, 1); } catch (e) { exception = e; }
|
|
||||||
ok(exception, "createOffer(step1, failed, 1) throws");
|
|
||||||
exception = null;
|
|
||||||
try { pconnects.createOffer(step1, failed, {}); } catch (e) { exception = e; }
|
|
||||||
ok(!exception, "createOffer(step1, failed, {}) succeeds");
|
|
||||||
exception = null;
|
|
||||||
try {
|
|
||||||
pconnect.updateIce();
|
|
||||||
} catch (e) {
|
|
||||||
ok(e.message.indexOf("updateIce") >= 0, "PeerConnection.js has readable exceptions");
|
|
||||||
exception = e;
|
|
||||||
}
|
|
||||||
ok(exception, "updateIce not yet implemented and throws");
|
|
||||||
exception = null;
|
|
||||||
try { pconnects.createOffer(step1, failed, { offerToReceiveVideo: false, offerToReceiveAudio: true, MozDontOfferDataChannel: true }); } catch (e) { exception = e; }
|
|
||||||
ok(!exception, "createOffer(step1, failed, { offerToReceiveVideo: false, offerToReceiveAudio: true, MozDontOfferDataChannel: true }) succeeds");
|
|
||||||
pconnect.close();
|
|
||||||
pconnects.close();
|
|
||||||
pconnect = null;
|
|
||||||
pconnects = null;
|
|
||||||
networkTestFinished();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</pre>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -43,21 +43,23 @@
|
|||||||
is(pc.signalingState, "closed", "Final signalingState stays at 'closed'");
|
is(pc.signalingState, "closed", "Final signalingState stays at 'closed'");
|
||||||
is(pc.iceConnectionState, "closed", "Final iceConnectionState stays at 'closed'");
|
is(pc.iceConnectionState, "closed", "Final iceConnectionState stays at 'closed'");
|
||||||
|
|
||||||
// TODO: according to the webrtc spec all of these should throw InvalidStateError's
|
// Due to a limitation in our WebIDL compiler that prevents overloads with
|
||||||
// instead they seem to throw simple Error's
|
// both Promise and non-Promise return types, legacy APIs with callbacks
|
||||||
SimpleTest.doesThrow(function() {
|
// are unable to continue to throw exceptions. Luckily the spec uses
|
||||||
pc.setLocalDescription(
|
// exceptions solely for "programming errors" so this should not hinder
|
||||||
"Invalid Session Description",
|
// working code from working, which is the point of the legacy API. All
|
||||||
function() {},
|
// new code should use the promise API.
|
||||||
function() {})},
|
//
|
||||||
"setLocalDescription() on closed PC raised expected exception");
|
// The legacy methods that no longer throw on programming errors like
|
||||||
|
// "invalid-on-close" are:
|
||||||
SimpleTest.doesThrow(function() {
|
// - createOffer
|
||||||
pc.setRemoteDescription(
|
// - createAnswer
|
||||||
"Invalid Session Description",
|
// - setLocalDescription
|
||||||
function() {},
|
// - setRemoteDescription
|
||||||
function() {})},
|
// - addIceCandidate
|
||||||
"setRemoteDescription() on closed PC raised expected exception");
|
// - getStats
|
||||||
|
//
|
||||||
|
// Other methods are unaffected.
|
||||||
|
|
||||||
SimpleTest.doesThrow(function() {
|
SimpleTest.doesThrow(function() {
|
||||||
pc.updateIce("Invalid RTC Configuration")},
|
pc.updateIce("Invalid RTC Configuration")},
|
||||||
@ -75,11 +77,6 @@
|
|||||||
pc.createDataChannel({})},
|
pc.createDataChannel({})},
|
||||||
"createDataChannel() on closed PC raised expected exception");
|
"createDataChannel() on closed PC raised expected exception");
|
||||||
|
|
||||||
// The spec says it has to throw, but it seems questionable why...
|
|
||||||
SimpleTest.doesThrow(function() {
|
|
||||||
pc.getStats()},
|
|
||||||
"getStats() on closed PC raised expected exception");
|
|
||||||
|
|
||||||
SimpleTest.doesThrow(function() {
|
SimpleTest.doesThrow(function() {
|
||||||
pc.setIdentityProvider("Invalid Provider")},
|
pc.setIdentityProvider("Invalid Provider")},
|
||||||
"setIdentityProvider() on closed PC raised expected exception");
|
"setIdentityProvider() on closed PC raised expected exception");
|
||||||
|
Loading…
Reference in New Issue
Block a user