mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
indexeddb: Allow deleting unknown DBs. (#38076)
The current behaviour is too strict according to the spec and is the cause of many intermittent test errors. Testing: Existing coverage is sufficient. Fixes: #37706 --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
30b6e289e0
commit
189e649222
7 changed files with 19 additions and 26 deletions
|
@ -297,11 +297,17 @@ impl IndexedDBManager {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SyncOperation::DeleteDatabase(sender, origin, db_name) => {
|
SyncOperation::DeleteDatabase(sender, origin, db_name) => {
|
||||||
|
// https://w3c.github.io/IndexedDB/#delete-a-database
|
||||||
|
// Step 4. Let db be the database named name in storageKey,
|
||||||
|
// if one exists. Otherwise, return 0 (zero).
|
||||||
let idb_description = IndexedDBDescription {
|
let idb_description = IndexedDBDescription {
|
||||||
origin,
|
origin,
|
||||||
name: db_name,
|
name: db_name,
|
||||||
};
|
};
|
||||||
self.databases.remove(&idb_description);
|
if self.databases.remove(&idb_description).is_none() {
|
||||||
|
let _ = sender.send(Ok(()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME:(rasviitanen) Possible security issue?
|
// FIXME:(rasviitanen) Possible security issue?
|
||||||
// FIXME:(arihant2math) using remove_dir_all with arbitrary input ...
|
// FIXME:(arihant2math) using remove_dir_all with arbitrary input ...
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
[database-names-by-origin.html]
|
[database-names-by-origin.html]
|
||||||
expected: TIMEOUT
|
|
||||||
[open database names don't leak to cross-origin iframe]
|
[open database names don't leak to cross-origin iframe]
|
||||||
expected: TIMEOUT
|
expected: FAIL
|
||||||
|
|
||||||
[open database names don't leak to cross-origin window]
|
[open database names don't leak to cross-origin window]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
[closed database names don't leak to cross-origin iframe]
|
[closed database names don't leak to cross-origin iframe]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
||||||
[closed database names don't leak to cross-origin window]
|
[closed database names don't leak to cross-origin window]
|
||||||
expected: NOTRUN
|
expected: FAIL
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[idb-binary-key-detached.any.html]
|
[idb-binary-key-detached.any.html]
|
||||||
|
expected: CRASH
|
||||||
[Detached ArrayBuffers must throw DataError when used as a key]
|
[Detached ArrayBuffers must throw DataError when used as a key]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -7,6 +8,7 @@
|
||||||
|
|
||||||
|
|
||||||
[idb-binary-key-detached.any.worker.html]
|
[idb-binary-key-detached.any.worker.html]
|
||||||
|
expected: CRASH
|
||||||
[Detached ArrayBuffers must throw DataError when used as a key]
|
[Detached ArrayBuffers must throw DataError when used as a key]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -11,18 +11,12 @@
|
||||||
[Empty name]
|
[Empty name]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Attempting to create an existing object store with a different keyPath throw ConstraintError ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Object store 'name' and 'keyPath' properties are correctly set ]
|
[Object store 'name' and 'keyPath' properties are correctly set ]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Attempt to create an object store outside of a version change transaction ]
|
[Attempt to create an object store outside of a version change transaction ]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Attempt to create an object store that already exists ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Attempt to create an object store with an invalid key path ]
|
[Attempt to create an object store with an invalid key path ]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -40,18 +34,12 @@
|
||||||
[Empty name]
|
[Empty name]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Attempting to create an existing object store with a different keyPath throw ConstraintError ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Object store 'name' and 'keyPath' properties are correctly set ]
|
[Object store 'name' and 'keyPath' properties are correctly set ]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Attempt to create an object store outside of a version change transaction ]
|
[Attempt to create an object store outside of a version change transaction ]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Attempt to create an object store that already exists ]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[Attempt to create an object store with an invalid key path ]
|
[Attempt to create an object store with an invalid key path ]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,9 @@
|
||||||
[idbfactory-deleteDatabase-request-success.any.worker.html]
|
[idbfactory-deleteDatabase-request-success.any.worker.html]
|
||||||
[IDBFactory deleteDatabase() request properties on success]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[idbfactory-deleteDatabase-request-success.any.serviceworker.html]
|
[idbfactory-deleteDatabase-request-success.any.serviceworker.html]
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
|
||||||
[idbfactory-deleteDatabase-request-success.any.html]
|
[idbfactory-deleteDatabase-request-success.any.html]
|
||||||
[IDBFactory deleteDatabase() request properties on success]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
||||||
[idbfactory-deleteDatabase-request-success.any.sharedworker.html]
|
[idbfactory-deleteDatabase-request-success.any.sharedworker.html]
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[idbrequest-onupgradeneeded.any.worker.html]
|
[idbrequest-onupgradeneeded.any.worker.html]
|
||||||
|
expected: TIMEOUT
|
||||||
[indexedDB.delete called from upgradeneeded handler]
|
[indexedDB.delete called from upgradeneeded handler]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -9,10 +10,11 @@
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[transaction oncomplete ordering relative to open request onsuccess]
|
[transaction oncomplete ordering relative to open request onsuccess]
|
||||||
expected: FAIL
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[idbrequest-onupgradeneeded.any.html]
|
[idbrequest-onupgradeneeded.any.html]
|
||||||
|
expected: TIMEOUT
|
||||||
[indexedDB.delete called from upgradeneeded handler]
|
[indexedDB.delete called from upgradeneeded handler]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -23,7 +25,7 @@
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[transaction oncomplete ordering relative to open request onsuccess]
|
[transaction oncomplete ordering relative to open request onsuccess]
|
||||||
expected: FAIL
|
expected: TIMEOUT
|
||||||
|
|
||||||
|
|
||||||
[idbrequest-onupgradeneeded.any.serviceworker.html]
|
[idbrequest-onupgradeneeded.any.serviceworker.html]
|
||||||
|
|
|
@ -5,10 +5,12 @@
|
||||||
expected: ERROR
|
expected: ERROR
|
||||||
|
|
||||||
[historical.any.worker.html]
|
[historical.any.worker.html]
|
||||||
|
expected: CRASH
|
||||||
[historical]
|
[historical]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
||||||
[historical.any.html]
|
[historical.any.html]
|
||||||
|
expected: CRASH
|
||||||
[historical]
|
[historical]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue