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 (409f3966645a)

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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=909670
-->
<head>
  <meta charset="utf-8">
  <title>Test for Media Recoder recording session</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
var manager = new MediaTestManager;

function startTest(test, token) {
  var element = document.createElement('audio');

  element.token = token;
  manager.started(token);

  element.src = test.name;
  element.test = test;
  element.stream = element.mozCaptureStream();

  var mStopCount = 0;
  // Start and stop recording session three times continuously.
  var mExpectStopCount = 3;
  var mediaRecorder = new MediaRecorder(element.stream);

  // Stop callback.
  // Suppose to receive mExpectStopCount
  mediaRecorder.onstop = function stopCallback() {
    mStopCount++;

    info("MediaRecorder.onstop callback: (" + mStopCount + ")");

    if (mExpectStopCount === mStopCount)
    {
      manager.finished(token);
    }
  }

  // data avaliable.
  mediaRecorder.ondataavailable = function(evt) {}

  mediaRecorder.onerror = function(err) {
    ok(false, 'Unexpected error fired with:' + err);
  }

  mediaRecorder.onwarning = function() {
    ok(false, 'Unexpected warning fired');
  }

  element.preload = "metadata";

  element.onloadedmetadata = function () {
    element.onloadedmetadata = null;
    element.play();
    for (var i = 0; i < mExpectStopCount; i++) {
      mediaRecorder.start(1000);
      mediaRecorder.stop();
    }
  }

}

manager.runTests(gMediaRecorderTests, startTest);

</script>
</pre>
</body>
</html>