async waitForFont(name) {
    await new Promise((resolve, reject) => {
      // https://github.com/zachleat/fontfaceonload
      // eslint-disable-next-line new-cap
      FontFaceOnload(name, {
        success: resolve,
        error: () => {
          reject(new Error('Timeout waiting for font ' + name + ' to load'));
        },
        timeout: 10 * 1000,  // ms
      });
    });

    // Wait one extra second to make sure the font rendering on the page has
    // been updated.  Without this, we saw some rare test flake in Firefox on
    // Mac.
    await shaka.test.Util.delay(1);
  }
Waits for a particular font to be loaded.  Useful in screenshot tests to
make sure we have consistent results with regard to the web fonts we load
in the UI.

@param {string} name
@return {!Promise}