Bug 106411 - IndexedDB: Update expected results for IndexedDB layout tests
Summary: IndexedDB: Update expected results for IndexedDB layout tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-08 20:40 PST by Michael Pruett
Modified: 2013-01-10 16:03 PST (History)
5 users (show)

See Also:


Attachments
Patch (21.45 KB, patch)
2013-01-08 20:46 PST, Michael Pruett
no flags Details | Formatted Diff | Diff
Patch (10.78 KB, patch)
2013-01-09 12:36 PST, Michael Pruett
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Pruett 2013-01-08 20:40:57 PST
A few layout tests in storage/indexeddb have different output on JSC than on V8. The V8 versions of these tests should be moved to platform/chromium/storage/indexeddb and the JSC output should be installed in storage/indexeddb.
Comment 1 Michael Pruett 2013-01-08 20:46:02 PST
Created attachment 181835 [details]
Patch
Comment 2 Benjamin Poulain 2013-01-08 23:24:23 PST
It is a reasonable change but it is very unfortunate.

Do you know what causes the difference between V8 and JSC?
Could we update the test or the test harness to make sure the results are the same?
Comment 3 Michael Pruett 2013-01-09 09:24:30 PST
(In reply to comment #2)
> It is a reasonable change but it is very unfortunate.
> 
> Do you know what causes the difference between V8 and JSC?
> Could we update the test or the test harness to make sure the results are the same?

Yes the differences in the expected results in these four test cases are caused by differences in error messages between V8 and JSC.

The error message regarding serializing cyclic structures in JSC is "JSON.stringify cannot serialize cyclic structures." (Source/JavaScriptCore/runtime/JSONObject.cpp line 412) while the comparable error message in V8 is "Converting circular structure to JSON" (v8/src/messages.js line 116).

V8 prepends the string "Uncaught " (v8/src/messages.js line 55) to uncaught exceptions whereas JSC does not.
Comment 4 Joshua Bell 2013-01-09 09:40:56 PST
> The error message regarding serializing cyclic structures in JSC is "JSON.stringify cannot serialize cyclic structures." (Source/JavaScriptCore/runtime/JSONObject.cpp line 412) while the comparable error message in V8 is "Converting circular structure to JSON" (v8/src/messages.js line 116).

We could alter these tests to catch and verify the exception name and code w/o showing the message.
 
> V8 prepends the string "Uncaught " (v8/src/messages.js line 55) to uncaught exceptions whereas JSC does not.

Unfortunately, we really need to keep these exceptions uncaught as that's what's being tested. (And for the record, catching with using window.onerror doesn't count as being "caught", but also does not prevent the message, so that's not helpful.)

Other thoughts?
Comment 5 Michael Pruett 2013-01-09 10:13:31 PST
The error messages relating to serializing cyclic structures are rather incidental to the functionality being tested:

shouldThrow("JSON.stringify(cyclic_array)");

These lines could be removed without affecting coverage of IndexedDB in the slightest.
Comment 6 Joshua Bell 2013-01-09 10:28:10 PST
(In reply to comment #5)
> The error messages relating to serializing cyclic structures are rather incidental to the functionality being tested:
> 
> shouldThrow("JSON.stringify(cyclic_array)");
> 
> These lines could be removed without affecting coverage of IndexedDB in the slightest.

Agreed.
Comment 7 Michael Pruett 2013-01-09 12:36:38 PST
Created attachment 181971 [details]
Patch

I've removed expected results for storage/indexeddb/key-type-array.html from this change since that test has been updated in bug 106472.

It's not ideal for these three IndexedDB layout tests to have slightly different results on JSC and V8, but eliminating these differences might be more trouble than it's worth.
Comment 8 Joshua Bell 2013-01-10 13:29:27 PST
(In reply to comment #7)
> It's not ideal for these three IndexedDB layout tests to have slightly different results on JSC and V8, but eliminating these differences might be more trouble than it's worth.

Unless anyone has any better ideas, I'm okay with this approach (i.e. different expectations files). 

(Apologies in advance for when us chromium-port folks commit the wrong thing if no  ews bots catch it.)
Comment 9 Tony Chang 2013-01-10 15:32:26 PST
FWIW, I think there are quite a few fast/js tests that have different results for Chromium because of V8 error messages being different.
Comment 10 Benjamin Poulain 2013-01-10 15:36:11 PST
(In reply to comment #9)
> FWIW, I think there are quite a few fast/js tests that have different results for Chromium because of V8 error messages being different.

Yes indeed.

I don't have any problem with landing this.
Comment 11 WebKit Review Bot 2013-01-10 16:03:06 PST
Comment on attachment 181971 [details]
Patch

Clearing flags on attachment: 181971

Committed r139384: <http://trac.webkit.org/changeset/139384>
Comment 12 WebKit Review Bot 2013-01-10 16:03:10 PST
All reviewed patches have been landed.  Closing bug.