Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/media/test/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  test_mediarecorder_creation_fail.html   Sprache: HTML

 

 products/Sources/formale Sprachen/C/Firefox/dom/media/test/test_mediarecorder_creation_fail.html


<!DOCTYPE HTML>
<html>
<head>
  <title>Test MediaRecorder Record with media.ogg.enabled = false</title>
  <script 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">
function testThrows(stream, options, errorName, message, testName) {
  try {
    new MediaRecorder(stream, options);
  } catch(e) {
    is(e.name, errorName, testName);
    is(e.message, message, testName);
    return;
  }
  ok(!errorName, testName);
}
(async () => {
  SimpleTest.waitForExplicitFinish();
  await SpecialPowers.pushPrefEnv({set: [
      ["media.ogg.enabled", false],
      ["media.encoder.webm.enabled", false],
    ]});
  const stream = new AudioContext().createMediaStreamDestination().stream;
  testThrows(
    stream, {mimeType: "audio/ogg"}, "NotSupportedError",
    "MediaRecorder constructor: audio/ogg indicates an unsupported container",
    "Creating an ogg recorder without ogg support throws");
  testThrows(
    stream, {mimeType: "audio/webm"}, "NotSupportedError",
    "MediaRecorder constructor: audio/webm indicates an unsupported container",
    "Creating a webm recorder without webm support throws");
  testThrows(
    stream, {mimeType: "video/webm"}, "NotSupportedError",
    "MediaRecorder constructor: video/webm indicates an unsupported container",
    "Creating a webm recorder without webm support throws");
  testThrows(
    stream, {mimeType: "apa/bepa"}, "NotSupportedError",
    "MediaRecorder constructor: apa/bepa is not a valid media type",
    "Creating a recorder for a bogus mime type throws");
  testThrows(
    stream, {}, null, null,
    "Creating a default recorder never throws, even without container support");
  const recorder = new MediaRecorder(stream);
  try {
    recorder.start();
    ok(false, "Starting a recorder without container support should throw");
  } catch(e) {
    is(e.name, "NotSupportedError",
      "Starting a recorder without container support throws");
  }
  SimpleTest.finish();
})();
</script>
</pre>
</body>
</html>

Messung V0.5 in Prozent
C=98 H=96 G=96

¤ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet am  2026-09-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.