await session.generateRequest('keyids', new TextEncoder().encode(JSON.stringify(initData)))
.catch(() => ok(false, `failed to generateRequest for ${keySystem}`));
await messagePromise;
return session;
}
add_task(async function testMalformedJSON() {
for (const keySystem of kKeySystems) {
const session = await createSessionWithRequest(keySystem);
if (!session) { continue; }
const garbage = new TextEncoder().encode("not valid json {{{{");
let rejected = false;
await session.update(garbage).catch(() => { rejected = true; });
ok(rejected, `${keySystem}: update() with malformed JSON should reject`);
}
});
add_task(async function testInvalidJWKStructure() {
for (const keySystem of kKeySystems) {
const session = await createSessionWithRequest(keySystem);
if (!session) { continue; }
add_task(async function testWrongTypeField() {
for (const keySystem of kKeySystems) {
const session = await createSessionWithRequest(keySystem);
if (!session) { continue; }
// Session is temporary but license response claims persistent-license
const mismatch = {
keys: [{
kty: "oct",
kid: "AAAAAAAAAAAAAAAAAAAAAA",
k: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=",
}],
type: "persistent-license",
};
const encoded = new TextEncoder().encode(JSON.stringify(mismatch));
let rejected = false;
await session.update(encoded).catch(() => { rejected = true; });
ok(rejected, `${keySystem}: update() with wrong type field should reject`);
}
});
add_task(async function testEmptyResponse() {
for (const keySystem of kKeySystems) {
const session = await createSessionWithRequest(keySystem);
if (!session) { continue; }
// Empty Uint8Array — MediaKeySession::Update() guards this at the JS layer
// with a TypeError before reaching the CDM.
const empty = new Uint8Array(0);
let caughtType = null;
await session.update(empty).catch(e => { caughtType = e.constructor.name; });
ok(caughtType !== null, `${keySystem}: update() with empty response should reject`);
}
});
</script>
</body>
</html>
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.25 Sekunden
(vorverarbeitet am 2026-09-30)
¤
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.