_onFileLoad(str) {
    let json;
    try {
      json = JSON.parse(str);
    } catch (e) {
      logger.error('Could not parse JSON file.');
      return;
    }

    try {
      this._replaceReportHtml(json);
    } catch (err) {
      logger.error(err.message);
    }

    document.dispatchEvent(new CustomEvent('lh-file-upload-test-ack'));
  }
Updates the page's HTML with contents of the JSON file passed in.
@param {string} str
@throws file was not valid JSON generated by Lighthouse or an unknown file
    type was used.
@private