static async cleanupUI() {
    // If we don't clean up the UI, these tests could pollute the environment
    // for other tests that run later, causing failures in unrelated tests.
    // This is causing particular issues on Tizen.
    const containers =
        document.querySelectorAll('[data-shaka-player-container]');

    const destroys = [];
    for (const container of containers) {
      const ui = /** @type {shaka.ui.Overlay} */(container['ui']);

      // Destroying the UI destroys the controls and player inside.
      destroys.push(ui.destroy());
    }

    const allDestroyed = Promise.all(destroys);
    // 10 seconds should be more than enough to tear down the UI.
    // Adding this silent timeout fixes several tests that inconsistently hang
    // during teardown and cause failures in afterEach() clauses.
    await Promise.race([allDestroyed, shaka.test.Util.delay(10)]);

    // Now remove all the containers from the DOM.
    for (const container of containers) {
      if (container.parentElement) {
        container.parentElement.removeChild(container);
      }
    }
  }
Thoroughly clean up after UI-related tests.

The UI tests can create lots of DOM elements (including videos) that are
easy to lose track of.  This is a universal cleanup system to avoid leaving
anything behind.