processMediaKeySystemAccess = async (keySystem, access) => {
      let mediaKeys;
      try {
        // Workaround: Our automated test lab runs Windows browsers under a
        // headless service.  In this environment, Firefox's CDMs seem to crash
        // when we create the CDM here.
        if (!device.createMediaKeysWhenCheckingSupport()) {
          // Reject this, since it crashes our tests.
          throw new Error('Suppressing Firefox Windows DRM in testing!');
        } else {
          // Otherwise, create the CDM.
          mediaKeys = await access.createMediaKeys();
        }
      } catch (error) {
        // In some cases, we can get a successful access object but fail to
        // create a MediaKeys instance.  When this happens, don't update the
        // support structure.  If a previous test succeeded, we won't overwrite
        // any of the results.
        return;
      }

      // If sessionTypes is missing, assume no support for persistent-license.
      const sessionTypes = access.getConfiguration().sessionTypes;
      let persistentState = sessionTypes ?
          sessionTypes.includes('persistent-license') : false;

      // Tizen 3.0 doesn't support persistent licenses, but reports that it
      // does.  It doesn't fail until you call update() with a license
      // response, which is way too late.
      // This is a work-around for #894.
      if (device.misreportsSupportForPersistentLicenses()) {
        persistentState = false;
      }

      const videoCapabilities = access.getConfiguration().videoCapabilities;
      const audioCapabilities = access.getConfiguration().audioCapabilities;

      let supportValue = {
        persistentState,
        encryptionSchemes: [],
        videoRobustnessLevels: [],
        audioRobustnessLevels: [],
        minHdcpVersions: [],
      };
      if (support.has(keySystem) && support.get(keySystem)) {
        // Update the existing non-null value.
        supportValue = support.get(keySystem);
      } else {
        // Set a new one.
        support.set(keySystem, supportValue);
      }

      // If the returned config doesn't mention encryptionScheme, the field
      // is not supported.  If installed, our polyfills should make sure this
      // doesn't happen.
      const returnedScheme = videoCapabilities[0].encryptionScheme;
      if (returnedScheme &&
          !supportValue.encryptionSchemes.includes(returnedScheme)) {
        supportValue.encryptionSchemes.push(returnedScheme);
      }

      const videoRobustness = videoCapabilities[0].robustness;
      if (videoRobustness &&
          !supportValue.videoRobustnessLevels.includes(videoRobustness)) {
        supportValue.videoRobustnessLevels.push(videoRobustness);
      }

      const audioRobustness = audioCapabilities[0].robustness;
      if (audioRobustness &&
          !supportValue.audioRobustnessLevels.includes(audioRobustness)) {
        supportValue.audioRobustnessLevels.push(audioRobustness);
      }

      if ('getStatusForPolicy' in mediaKeys) {
        const promises = [];
        for (const hdcpVersion of hdcpVersions) {
          if (supportValue.minHdcpVersions.includes(hdcpVersion)) {
            continue;
          }
          promises.push(mediaKeys.getStatusForPolicy({
            minHdcpVersion: hdcpVersion,
          }).then((status) => {
            if (status == 'usable' &&
                !supportValue.minHdcpVersions.includes(hdcpVersion)) {
              supportValue.minHdcpVersions.push(hdcpVersion);
            }
          }));
        }
        await Promise.all(promises);
      }
    }
@param {string} keySystem
@param {MediaKeySystemAccess} access
@return {!Promise}