Bug 60186 - Port Mozilla's IndexedDB tests: transaction lifetimes
Summary: Port Mozilla's IndexedDB tests: transaction lifetimes
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-04 11:02 PDT by Mark Pilgrim (Google)
Modified: 2012-07-03 15:08 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.94 KB, patch)
2011-05-04 11:03 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff
Patch (5.01 KB, patch)
2011-05-18 14:47 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff
Patch (5.23 KB, patch)
2011-05-20 06:34 PDT, Mark Pilgrim (Google)
levin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Pilgrim (Google) 2011-05-04 11:02:23 PDT
http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_transaction_lifetimes.html?force=1

This is a port of a test from Mozilla's IndexedDB test suite. It checks that transactions expire upon completion, i.e. that they can not be reused once they are complete.

WebKit passes this test.
Comment 1 Mark Pilgrim (Google) 2011-05-04 11:03:50 PDT
Created attachment 92284 [details]
Patch
Comment 2 David Grogan 2011-05-04 14:19:32 PDT
Comment on attachment 92284 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=92284&action=review

> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:56
> +    transaction = evalAndLog("transaction = db.transaction('foo');");

I think a transaction with nothing to do aborts; could you add an onabort handler with testPassed("empty transaction aborted") or something similar?
Comment 3 Mark Pilgrim (Google) 2011-05-18 07:39:15 PDT
I don't see anything in the spec to back up that assertion. Also, WebKit does not appear to trigger onabort in this test.
Comment 4 David Grogan 2011-05-18 11:52:16 PDT
(In reply to comment #2)
> (From update of attachment 92284 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=92284&action=review
> 
> > LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:56
> > +    transaction = evalAndLog("transaction = db.transaction('foo');");
> 
> I think a transaction with nothing to do aborts; could you add an onabort handler with testPassed("empty transaction aborted") or something similar?

(In reply to comment #3)
> I don't see anything in the spec to back up that assertion. Also, WebKit does not appear to trigger onabort in this test.

I was referring to behavior described here:
http://trac.webkit.org/browser/trunk/LayoutTests/storage/indexeddb/tutorial.html#L209

If onabort doesn't get called, could you add onabort = unexpectedAbortCalled (or whatever its name is)?
Comment 5 David Grogan 2011-05-18 11:54:13 PDT
Comment on attachment 92284 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=92284&action=review

> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:53
> +    evalAndLog("event.target.transaction.oncomplete = checkTransaction;");

What is event.target?  db?
Comment 6 Mark Pilgrim (Google) 2011-05-18 14:40:59 PDT
(In reply to comment #3)
> I don't see anything in the spec to back up that assertion. Also, WebKit does not appear to trigger onabort in this test.

I was wrong on both counts. Updating test as you originally suggested.
Comment 7 Mark Pilgrim (Google) 2011-05-18 14:41:37 PDT
(In reply to comment #5)
> (From update of attachment 92284 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=92284&action=review
> 
> > LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:53
> > +    evalAndLog("event.target.transaction.oncomplete = checkTransaction;");
> 
> What is event.target?  db?

Yes.
Comment 8 Mark Pilgrim (Google) 2011-05-18 14:47:33 PDT
Created attachment 93985 [details]
Patch
Comment 9 David Grogan 2011-05-19 13:51:44 PDT
Comment on attachment 93985 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=93985&action=review

informal r+, pending additional comment about transaction inside setVersion transaction

> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:56
> +    transaction = evalAndLog("transaction = db.transaction('foo');");

Sorry, one last request.  Can you add a comment that this test might have to be refactored when http://www.w3.org/Bugs/Public/show_bug.cgi?id=11401 is resolved?  It seems as though creating a transaction inside a setVersion transaction will be forbidden, based on the latest discussion: http://lists.w3.org/Archives/Public/public-webapps/2011AprJun/0608.html
Comment 10 Mark Pilgrim (Google) 2011-05-20 06:34:11 PDT
Created attachment 94209 [details]
Patch
Comment 11 Mark Pilgrim (Google) 2011-05-20 06:35:12 PDT
(In reply to comment #10)
> Created an attachment (id=94209) [details]
> Patch

This adds a debug statement linking to the unresolved WG bug.
Comment 12 David Grogan 2011-05-20 13:55:19 PDT
r+

Thanks
Comment 13 David Levin 2011-05-23 10:06:27 PDT
Comment on attachment 94209 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94209&action=review

> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:1
> +<!DOCTYPE html>

Where is the layoutTestController.dumpAsText() call?

> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:6
> +      http://creativecommons.org/publicdomain/zero/1.0/ "

This license isn't one of the two that is allowed. Perhaps you can ask if this is ok on webkit-dev.
Comment 14 David Levin 2011-05-23 10:07:00 PDT
Comment on attachment 94209 [details]
Patch

r- pending resolution of my two comments.
Comment 15 Tony Chang 2011-05-23 10:46:00 PDT
Comment on attachment 94209 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94209&action=review

>> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:6
>> +      http://creativecommons.org/publicdomain/zero/1.0/ "
> 
> This license isn't one of the two that is allowed. Perhaps you can ask if this is ok on webkit-dev.

It's public domain, so it has no copyright/license (e.g., like sqlite).
Comment 16 Mark Pilgrim (Google) 2011-05-25 18:28:39 PDT
(In reply to comment #13)
> (From update of attachment 94209 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=94209&action=review
> 
> > LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:1
> > +<!DOCTYPE html>
> 
> Where is the layoutTestController.dumpAsText() call?

None of the other IndexedDB tests (mine or existing ones) have this call.

> 
> > LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:6
> > +      http://creativecommons.org/publicdomain/zero/1.0/ "
> 
> This license isn't one of the two that is allowed. Perhaps you can ask if this is ok on webkit-dev.

Is Tony's comment sufficient?
Comment 17 Tony Chang 2011-05-26 09:26:40 PDT
Comment on attachment 94209 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=94209&action=review

>>> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:1
>>> +<!DOCTYPE html>
>> 
>> Where is the layoutTestController.dumpAsText() call?
> 
> None of the other IndexedDB tests (mine or existing ones) have this call.

It's in js-test-pre.js.
Comment 18 David Grogan 2011-08-25 17:07:32 PDT
Mark, it looks like this patch was forgotten.  Can it be committed if Dave Levin is satisfied?
Comment 19 David Levin 2011-09-04 03:59:08 PDT
(In reply to comment #15)
> (From update of attachment 94209 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=94209&action=review
> 
> >> LayoutTests/storage/indexeddb/mozilla/transaction-lifetimes.html:6
> >> +      http://creativecommons.org/publicdomain/zero/1.0/ "
> > 
> > This license isn't one of the two that is allowed. Perhaps you can ask if this is ok on webkit-dev.
> 
> It's public domain, so it has no copyright/license (e.g., like sqlite).

As I suggested, perhaps you can ask on webkit-dev because this doesn't seem complaint to me.

When one becomes a committer, one signs a document saying that they will only let in code that is one of those two licenses, It also says:

  "If a contributed source file does not have any licensing terms attached to it, do not commit it to the 
repository. Instead, please contact the author to determine what the intended licensing terms are.  If you need assistance with this, contact the WebKit team."

So this code doesn't seem acceptable. I'll admit that these license issues simply confuse me -- personally I wish it was all simpler -- which is why I mentioned emailing webkit-dev previously for clarification because I believe others there can help clarify this (while I cannot).
Comment 20 Joshua Bell 2012-07-03 15:08:11 PDT
This will be redundant with https://bugs.webkit.org/show_bug.cgi?id=90412 (which also changes the semantics of an empty transaction from aborting to completing, which makes this test invalid)