Fix IndexedDB unit tests
Created attachment 164804 [details] Patch
Josh, could you take a look at this?
Comment on attachment 164804 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164804&action=review > Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp:450 > + if (m_version == NoStringVersion && m_intVersion == IDBDatabaseMetadata::NoIntVersion && m_transactionCoordinator) { I'm uncomfortable with this. This is basically using m_transactionCoordinator as an "if null, I'm in test mode, so behave differently" flag which doesn't make for a good unit test; the behavior change has nothing to do with the coordinator itself (e.g. skipping a call, etc) It looks like this introduces a way for tests to bypass the open/upgradeneeded pattern to simplify the test. Could the test call openConnectionWithVersion(cb1, cb2, 0) and get the behavior that way?
Comment on attachment 164804 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=164804&action=review >> Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp:450 >> + if (m_version == NoStringVersion && m_intVersion == IDBDatabaseMetadata::NoIntVersion && m_transactionCoordinator) { > > I'm uncomfortable with this. This is basically using m_transactionCoordinator as an "if null, I'm in test mode, so behave differently" flag which doesn't make for a good unit test; the behavior change has nothing to do with the coordinator itself (e.g. skipping a call, etc) > > It looks like this introduces a way for tests to bypass the open/upgradeneeded pattern to simplify the test. Could the test call openConnectionWithVersion(cb1, cb2, 0) and get the behavior that way? So, the behavior change was at least slightly related to the coordinator - it was the null transaction coordinator that caused an invalid memory access if an int version transaction was run. But you're right about openConnectionWithVersion, it's possible to get the desired behavior by changing just test code, which seems a lot safer.
Created attachment 164818 [details] Patch
(In reply to comment #4) > > So, the behavior change was at least slightly related to the coordinator - it was the null transaction coordinator that caused an invalid memory access if an int version transaction was run. Thanks - I didn't trace it all the way through. > But you're right about openConnectionWithVersion, it's possible to get the desired behavior by changing just test code, which seems a lot safer. Cool - I wasn't sure. New patch LGTM (although the -1 magic number might catch someone's attention...)
Created attachment 164977 [details] Patch
Nate, could you review this? jsbell@ gave it the LGTM in c6
Nate, never mind, just noticed you're gardening. Tony, could you review this?
Comment on attachment 164977 [details] Patch Clearing flags on attachment: 164977 Committed r129170: <http://trac.webkit.org/changeset/129170>
All reviewed patches have been landed. Closing bug.