async function clearDataForOrigin(session, url, clearStorageTypes) {
  const status = {msg: 'Cleaning origin data', id: 'lh:storage:clearDataForOrigin'};
  log.time(status);

  const warnings = [];

  const origin = new URL(url).origin;

  const typesToClear = clearStorageTypes.join(',');

  // `Storage.clearDataForOrigin` is one of our PROTOCOL_TIMEOUT culprits and this command is also
  // run in the context of PAGE_HUNG to cleanup. We'll keep the timeout low and just warn if it fails.
  session.setNextProtocolTimeout(5000);

  try {
    await session.sendCommand('Storage.clearDataForOrigin', {
      origin: origin,
      storageTypes: typesToClear,
    });
  } catch (err) {
    if (/** @type {LH.LighthouseError} */ (err).code === 'PROTOCOL_TIMEOUT') {
      log.warn('Driver', 'clearDataForOrigin timed out');
      warnings.push(str_(UIStrings.warningOriginDataTimeout));
    } else {
      throw err;
    }
  } finally {
    log.timeEnd(status);
  }

  return warnings;
}
@param {LH.Gatherer.ProtocolSession} session
@param {string} url
@param {LH.Config.Settings['clearStorageTypes']} clearStorageTypes
@return {Promise<LH.IcuMessage[]>}