Bug 62370

Summary: IndexedDB deleteIndex should throw NOT_ALLOWED_ERR if called outside a VERSION_CHANGE transaction callback
Product: WebKit Reporter: Mark Pilgrim (Google) <pilgrim>
Component: New BugsAssignee: Joshua Bell <jsbell>
Status: RESOLVED FIXED    
Severity: Normal CC: dgrogan, hans, jsbell, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
test case
none
Patch
none
Patch none

Description Mark Pilgrim (Google) 2011-06-09 05:48:06 PDT
Created attachment 96576 [details]
test case

http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBObjectStore-deleteIndex-void-DOMString-indexName states "Note that this method must only be called from a VERSION_CHANGE transaction callback. ... NOT_ALLOWED_ERR [indicates] This method was not called from a VERSION_CHANGE transaction callback."

This test opens a database, creates an objectstore, creates an index, waits for the VERSION_CHANGE transaction to end, and then attempts to delete the index.

Expected behavior: throws webkitIDBDatabaseException.NOT_ALLOWED_ERR
Actual behavior: throws webkitIDBDatabaseException.NOT_FOUND_ERR

Test case attached.
Comment 1 Joshua Bell 2011-10-24 16:17:42 PDT
This functions correctly now (circa M16), but we don't appear to have a layout test for this case. We should add Mark's test.
Comment 2 Joshua Bell 2011-11-23 12:57:39 PST
Created attachment 116404 [details]
Patch
Comment 3 Joshua Bell 2011-11-23 15:09:27 PST
Created attachment 116437 [details]
Patch
Comment 4 Joshua Bell 2011-11-23 15:10:24 PST
Comment on attachment 116437 [details]
Patch

removed stylesheet link
Comment 5 Hans Wennborg 2011-11-24 08:03:44 PST
Looks good to me.
Comment 6 Joshua Bell 2011-12-07 10:43:52 PST
tony@ - r? cq?
Comment 7 WebKit Review Bot 2011-12-07 13:18:46 PST
Comment on attachment 116437 [details]
Patch

Clearing flags on attachment: 116437

Committed r102269: <http://trac.webkit.org/changeset/102269>
Comment 8 WebKit Review Bot 2011-12-07 13:18:52 PST
All reviewed patches have been landed.  Closing bug.