Race between creating/deleting a database in test
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Aug 2016 00:10:29 +0000 (00:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Aug 2016 00:10:29 +0000 (00:10 +0000)
commit7fe28a71c3f3b45f1c6d47eb725e9e1790bd129d
tree097a04d0f1e4a8c0b1cd4582081e0cac4ac9a61a
parent011e4d9d5d9773ff6e1d22d2ad5fcc4620c3e686
Race between creating/deleting a database in test
https://bugs.webkit.org/show_bug.cgi?id=161285

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-08-27
Reviewed by Darin Adler.

Because IndexedDB creation is asynchronous, we were not waiting for the
database to be completely open before sending more commands. These
could race and give unexpected results. Wait for the database to be
successfully created before interacting with it.

* inspector/indexeddb/resources/utilities.js:
(createEmptyDatabase):
(createDatabaseWithStores):
Send a single when the database creation is completed.

* inspector/indexeddb/clearObjectStore-expected.txt:
* inspector/indexeddb/clearObjectStore.html:
* inspector/indexeddb/deleteDatabaseNamesWithSpace.html:
* inspector/indexeddb/requestData-expected.txt:
* inspector/indexeddb/requestDatabase-expected.txt:
* inspector/indexeddb/requestDatabase.html:
* inspector/indexeddb/requestDatabaseNames.html:
Listen for the database created signal before proceeding
with the test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/indexeddb/clearObjectStore-expected.txt
LayoutTests/inspector/indexeddb/clearObjectStore.html
LayoutTests/inspector/indexeddb/deleteDatabaseNamesWithSpace.html
LayoutTests/inspector/indexeddb/requestData-expected.txt
LayoutTests/inspector/indexeddb/requestDatabase-expected.txt
LayoutTests/inspector/indexeddb/requestDatabase.html
LayoutTests/inspector/indexeddb/requestDatabaseNames.html
LayoutTests/inspector/indexeddb/resources/utilities.js