IndexedDB: Rewrite confusing call sequence layout tests
Created attachment 164634 [details]
This is a work in progress - I want to go through and rewrite two of the layout tests that push IDB through a series of states. The tests (which I wrote when I was a n00b!) are written in a fairly confusing style using a wrapper object around the IDB API. This makes them difficult to maintain and understand.
I plan to leave the intent of the tests intact and ensure that the tests still push IDB through the same set of states (opening/closing/versioning/deleting) databases, but with simpler, more "idiomatic" code, and eventually break them out into separate files.
The two tests are:
I've tackled the first sub-test of open-close-version.html, attached. The output differs by tweaking the database name (a change), using evalAndLog() for API calls (more spammy), adding assertions about sequence (the ++state thingy), and removing the summary "concate the states together and make sure the strings match" which was confusing and redundant.
If this looks acceptable I'll do the rest to the other sub-tests, land, then do a clean-up pass removing a lot of the extraneous debug() calls, land, then finally split the tests up into separate files.
Created attachment 164774 [details]
The latest patch goes ahead and converts all of those tests over. The *-expected.txt diffs are minimized to show that the tests themselves are doing the same thing as previously. Once this has landed I'll split them into separate files, update the output, and eliminate some of the nested functions to make them easier to read.
dgrogan@, alecflett@ - please take a look
tony@ - test only changes - r? cq?
Comment on attachment 164774 [details]
Clearing flags on attachment: 164774
Committed r129142: <http://trac.webkit.org/changeset/129142>
All reviewed patches have been landed. Closing bug.