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

Quelle  browser_wmfme_cdm_info.js   Sprache: JAVA

 

/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */


"use strict";

/**
 * Exercises ChromeUtils.getWMFContentDecryptionModuleInformation(), which
 * dispatches through UtilityMediaServiceChild::GetKeySystemCapabilities and
 * populates dom::CDMInformation entries.
 *
 * MFCDMParent::GetAllKeySystemsCapabilities enumerates a compile-time-fixed
 * table of key systems, each tagged SecureLevel::Software or
 * SecureLevel::Hardware. That tag becomes capabilities.isHardwareDecryption()
 * over IPDL. This test mirrors that table and asserts every reported CDM's
 * isHardwareDecryption matches its static tag, so the assertion holds across
 * hosts that expose different subsets of key systems (CI without hardware
 * DRM, developer hosts with hardware-backed PlayReady, hardware-only
 * configurations).
 */


// Mirror of dom/media/ipc/MFCDMParent.cpp GetAllKeySystemsCapabilities key
// system table. Keep in sync with the SecureLevel tags assigned there.
const kExpectedIsHardwareDecryption = new Map([
  ["com.microsoft.playready.recommendation", false],
  ["com.microsoft.playready.recommendation.3000", true],
  ["com.microsoft.playready.recommendation.3000.clearlead", true],
]);

add_task(async function setupTestingPref() {
  await SpecialPowers.pushPrefEnv({
    set: [
      ["media.wmf.media-engine.enabled", 1],
      ["media.eme.playready.enabled", true],
    ],
  });
});

add_task(async function test_cdm_isHardwareDecryption_initialized() {
  // The CDM info chrome API doesn't need a content page, but doing the
  // assertions inside an explicit about:blank tab gives the initial
  // about:newtab inner window a clean lifecycle (opened, used, removed)
  // before the leak checker runs. Without this, about:newtab can
  // intermittently survive past shutdown.
  await BrowserTestUtils.withNewTab("about:blank", async () => {
    const cdms = await ChromeUtils.getWMFContentDecryptionModuleInformation();
    for (const cdm of cdms) {
      Assert.ok(
        kExpectedIsHardwareDecryption.has(cdm.keySystemName),
        `${cdm.keySystemName}: known WMF key system (update test mirror if intentional)`
      );
      is(
        cdm.isHardwareDecryption,
        kExpectedIsHardwareDecryption.get(cdm.keySystemName),
        `${cdm.keySystemName}: isHardwareDecryption matches MFCDMParent SecureLevel tag`
      );
    }
  });
});

Messung V0.5 in Prozent
C=85 H=85 G=84

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-09-30) ¤

*© 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.