static createDatabase_(name, savedDatabase) {
    return new Promise((resolve, reject) => {
      const request = indexedDB.open(name, savedDatabase.version);

      request.onupgradeneeded = (event) => {
        shaka.log.debug('DB upgrade from', event.oldVersion, 'to',
            savedDatabase.version);
        const transaction = event.target.transaction;
        const db = transaction.db;

        // We will ignore existing stores, so first make a map of them.
        const existingStoreMap = {};
        for (const storeName of db.objectStoreNames) {
          existingStoreMap[storeName] = true;
        }

        for (const storeName in savedDatabase.stores) {
          if (storeName in existingStoreMap) {
            shaka.log.debug('Ignoring existing store', storeName);
          } else {
            const storeInfo = savedDatabase.stores[storeName];

            // Legacy Edge can't handle a null keyPath, and throws errors if you
            // specify that.  So delete it if it's null.
            if (storeInfo.parameters.keyPath == null) {
              delete storeInfo.parameters.keyPath;
            }

            shaka.log.debug('Creating store', storeName, storeInfo.parameters);
            db.createObjectStore(storeName, storeInfo.parameters);
          }
        }

        // If there isn't an oncomplete on transaction, we seem not to get a
        // call to request.onsuccess.  Perhaps the browser blocks the
        // transaction or request until there is an oncomplete handler.
        transaction.oncomplete = (event) => {};
      };

      request.onsuccess = (event) => {
        /** @type {IDBDatabase} */
        const db = event.target.result;
        resolve(db);
      };

      request.onerror = (event) => {
        event.preventDefault();
        reject(request.error);
      };
    });
  }
Creates a database.  Does not populate it.

@param {string} name The name of the database to create.
@param {shaka.test.CannedIDB.SavedDatabase} savedDatabase An object
  containing the database definition and the data to populate it with.
@return {!Promise<IDBDatabase>} Resolved when the named DB has been
  created.
@private