const allTests = [...singleCodecTests, ...pairedCodecTests];
const counters = {};
for (const { mimeType, labels } of allTests) {
dump(`Testing MediaRecorder.isTypeSupported with mimeType: ${mimeType}, labels: [${labels.join(", ")}]\n`);
MediaRecorder.isTypeSupported(mimeType);
// A single call can update multiple counters, so we check each expected label.
const LabeledCounters = {};
for (const label of labels) {
LabeledCounters[label] = (LabeledCounters[label] || 0) + 1;
}
dump(` Expected increments: ${JSON.stringify(LabeledCounters)}\n`);
for (const label of Object.keys(LabeledCounters)) {
counters[label] = (counters[label] || 0) + LabeledCounters[label];
const value = await GleanTest.mediaRecorder.mimeTypeQuery[label].testGetValue();
is(value, counters[label], `count for label'${label}' from mimeType '${mimeType}' should be ${counters[label]}`);
}
}
MediaRecorder.isTypeSupported("");
const emptyValue = await GleanTest.mediaRecorder.mimeTypeQuery.empty.testGetValue();
is(emptyValue, 1, `count for empty mime type in MediaRecorder.isTypeSupported should be 1`);
MediaRecorder.isTypeSupported("blah");
const othersValue = await GleanTest.mediaRecorder.mimeTypeQuery.others.testGetValue();
is(othersValue, 1, `count for invalid mime type in MediaRecorder.isTypeSupported should be 1`);
// testGetValue returns value of the stored metric, or null if there is no value.
const unusedValue = await GleanTest.mediaRecorder.mimeTypeQuery.mkv_pcm.testGetValue();
is(unusedValue, null, `count for unused mime type in MediaRecorder.isTypeSupported should be null`);
});
</script>
</body>
</html>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-09-28)
¤
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.