RESOLVED FIXED 106731
IndexedDB: Fix tests which depend upon V8 event listener behavior
https://bugs.webkit.org/show_bug.cgi?id=106731
Summary IndexedDB: Fix tests which depend upon V8 event listener behavior
Michael Pruett
Reported 2013-01-12 17:07:09 PST
Currently two IndexedDB tests fail when run on JSC because they depend upon event listener behavior which differs between V8 and JSC. V8 sets window.event for all event listeners to the current event and resets this variable to its previous state once the event listener has returned. In JSC by contrast, once window.event is overridden in user code, the user-defined definition persists and will not be reset when calling subsequent event listeners. Two tests, storage/indexeddb/cursor-advance.html and storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange.html, set window.event and then depend upon the value of this variable to be reset in a subsequent event handler. These tests should be modified to work on JSC.
Attachments
Patch (3.77 KB, patch)
2013-01-12 17:16 PST, Michael Pruett
no flags
Patch (26.26 KB, patch)
2013-01-15 11:54 PST, Joshua Bell
no flags
Patch (28.29 KB, patch)
2013-01-15 12:27 PST, Joshua Bell
no flags
Michael Pruett
Comment 1 2013-01-12 17:16:09 PST
Joshua Bell
Comment 2 2013-01-12 17:28:22 PST
The preamble(evt) pattern is used so that the tests will run in both a window context and in a worker context - workers don't set a global event property. We don't yet have HTML files for running them all in worker contexts, so this patch probably won't fail EWS but we'd like to keep (or update) that pattern. Agreed that the tests should be updated, but we'll need to decide what to do for these tests in Workers. (I'll be able to look more closely on Monday.)
Joshua Bell
Comment 3 2013-01-15 11:54:47 PST
Joshua Bell
Comment 4 2013-01-15 11:56:06 PST
I attached a different approach (that Michael and I discussed on IRC) that uses preamble(evt) consistently. This has the happy side effect of making the tests run in workers, so I added the *-workers.html wrappers for these. Michael - can you confirm that these work in your in-progress port?
Joshua Bell
Comment 5 2013-01-15 12:27:35 PST
Joshua Bell
Comment 6 2013-01-15 12:28:08 PST
Oops, one more try. Thanks Michael! If Michael gives this the thumbs up, tony@ can you r?
Michael Pruett
Comment 7 2013-01-15 12:32:37 PST
(In reply to comment #6) > Oops, one more try. Thanks Michael! > > If Michael gives this the thumbs up, tony@ can you r? This change looks good to me. The tests pass in WebKitGTK+.
Joshua Bell
Comment 8 2013-01-15 14:25:31 PST
Comment on attachment 182826 [details] Patch Thanks, tony@ !
WebKit Review Bot
Comment 9 2013-01-15 14:29:23 PST
Comment on attachment 182826 [details] Patch Clearing flags on attachment: 182826 Committed r139793: <http://trac.webkit.org/changeset/139793>
WebKit Review Bot
Comment 10 2013-01-15 14:29:27 PST
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.