Closed
Description
The WPT test for IDBFactory.databases() has a test for Ensure that databases() doesn't pick up changes that haven't commited.
It tests by:
- Creating a database
- Creating another database, but this time calling
IDBFactory.databases()
inonupgradeneeded
From my understanding, the database should exist before any attempts to upgrade the database.
Open a database connection step 6, creates a new database, and step 10.6 runs the upgrade a database
As such, the result of this
const db1 = await createNamedDatabase(testCase, "DB1", ()=>{});
let databases_promise1;
const db2 = await createNamedDatabase(testCase, "DB2", async () => {
databases_promise1 = indexedDB.databases();
// Give databases() operation a chance to fetch all current info about
// existing databases. This must be a sync sleep since await would trigger
// auto commit of the upgrade transaction.
sleep_sync(1000);
});
const databases_result1 = await databases_promise1;
databases_result1.length
should be 2, not 1, as the test expects.
Is there something im missing here? Should maybe databases with version 0 not be counted in this?