DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (27a812186ff4)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
<!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: "825703",
    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.createOffer(step1, failed, { mandatory: { FooBar: true } });
    } catch (e) {
        ok(e.message.indexOf("FooBar") > 0, "createOffer has readable exceptions");
        exception = e;
    }
    ok(exception, "createOffer(step1, failed, { mandatory: { FooBar: true } }) throws");
    exception = null;
    try { pconnects.createOffer(step1, failed, { optional: [] }); } catch (e) { exception = e; }
    ok(!exception, "createOffer(step1, failed, { optional: [] }) succeeds");
    exception = null;
    try { pconnect.createOffer(step1, failed, { optional: [1] }); } catch (e) { exception = e; }
    ok(exception, "createOffer(step1, failed, { optional: [1] }) throws");
    exception = null;
    try { pconnect.createOffer(step1, failed, { optional: [{ OfferToReceiveVideo: false, OfferToReceiveAudio: true, }] }); } catch (e) { exception = e; }
    ok(exception, "createOffer(step1, failed, { optional: [{ OfferToReceiveVideo: false, OfferToReceiveAudio: true, }] }) throws");
    exception = null;
    try { pconnects.createOffer(step1, failed, { mandatory: { OfferToReceiveVideo: false, OfferToReceiveAudio: true, MozDontOfferDataChannel: true}, optional: [{ VoiceActivityDetection: true }, { FooBar: "42"  }] }); } catch (e) { exception = e; }
    ok(!exception, "createOffer(step1, failed, { mandatory: { OfferToReceiveVideo: false, OfferToReceiveAudio: true, MozDontOfferDataChannel: true}, optional: [{ VoiceActivityDetection: true }, { FooBar: \"42\"  }] }) succeeds");
    pconnect = null;
    pconnects = null;
    networkTestFinished();
  });
</script>
</pre>
</body>
</html>