WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 97149
Fix IndexedDB unit tests
https://bugs.webkit.org/show_bug.cgi?id=97149
Summary
Fix IndexedDB unit tests
David Grogan
Reported
2012-09-19 16:51:32 PDT
Fix IndexedDB unit tests
Attachments
Patch
(3.56 KB, patch)
2012-09-19 16:57 PDT
,
David Grogan
no flags
Details
Formatted Diff
Diff
Patch
(2.84 KB, patch)
2012-09-19 18:41 PDT
,
David Grogan
no flags
Details
Formatted Diff
Diff
Patch
(2.94 KB, patch)
2012-09-20 13:59 PDT
,
David Grogan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
David Grogan
Comment 1
2012-09-19 16:57:54 PDT
Created
attachment 164804
[details]
Patch
David Grogan
Comment 2
2012-09-19 16:58:18 PDT
Josh, could you take a look at this?
Joshua Bell
Comment 3
2012-09-19 17:09:29 PDT
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?
David Grogan
Comment 4
2012-09-19 18:39:45 PDT
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.
David Grogan
Comment 5
2012-09-19 18:41:28 PDT
Created
attachment 164818
[details]
Patch
Joshua Bell
Comment 6
2012-09-19 19:43:22 PDT
(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...)
David Grogan
Comment 7
2012-09-20 13:59:13 PDT
Created
attachment 164977
[details]
Patch
David Grogan
Comment 8
2012-09-20 14:06:59 PDT
Nate, could you review this? jsbell@ gave it the LGTM in c6
David Grogan
Comment 9
2012-09-20 14:09:48 PDT
Nate, never mind, just noticed you're gardening. Tony, could you review this?
WebKit Review Bot
Comment 10
2012-09-20 14:45:34 PDT
Comment on
attachment 164977
[details]
Patch Clearing flags on attachment: 164977 Committed
r129170
: <
http://trac.webkit.org/changeset/129170
>
WebKit Review Bot
Comment 11
2012-09-20 14:45:38 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug