Bug 36666 - Newly added test open-database-over-quota.html fails for chromium
: Newly added test open-database-over-quota.html fails for chromium
Status: RESOLVED WONTFIX
: WebKit
HTML DOM
: 528+ (Nightly build)
: All All
: P2 Major
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2010-03-26 10:17 PST by
Modified: 2013-04-08 10:59 PST (History)


Attachments
Patch (1.53 KB, patch)
2010-03-26 10:49 PST, Eric U.
no flags Review Patch | Details | Formatted Diff | Diff
Patch (2.26 KB, patch)
2010-03-26 11:35 PST, Eric U.
levin: review-
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2010-03-26 10:17:49 PST
Run the layout test for chromium and you get 
  This tests that calling openDatabase with a size over 5MB doesn't assert on debug builds.
  FAIL: We shouldn't have been able to open the database.
------- Comment #1 From 2010-03-26 10:49:09 PST -------
Created an attachment (id=51759) [details]
Patch
------- Comment #2 From 2010-03-26 10:55:33 PST -------
(From update of attachment 51759 [details])
So now this will test less. Good for cross-platform portability of the test, but not as good for test coverage.

Shouldn't we have a test that actually checks the behavior of over-quota opening? Even if the results are currently different for different platforms.
------- Comment #3 From 2010-03-26 11:11:54 PST -------
The point of this test was to verify that a particular crash was fixed.

The behavior of openDatabase with a too-big requested size isn't actually defined in http://dev.w3.org/html5/webdatabase/; either returning a database or throwing an exception is a reasonable response.  I don't think we need to constrain that further with a test.
------- Comment #4 From 2010-03-26 11:35:50 PST -------
Created an attachment (id=51766) [details]
Patch
------- Comment #5 From 2010-03-26 12:50:39 PST -------
(In reply to comment #3)
> The behavior of openDatabase with a too-big requested size isn't actually
> defined in http://dev.w3.org/html5/webdatabase/; either returning a database or
> throwing an exception is a reasonable response.  I don't think we need to
> constrain that further with a test.

There may be a misunderstanding here about the purpose of our tests.

A test doesn't "constrain" -- it exercises code and demonstrates that it still behaves the same as when the test was originally checked in.

Tests should not be limited to things specified in the standards. Our goal is to exercise our code and make sure it's doing what we think it is.
------- Comment #6 From 2010-03-26 12:55:22 PST -------
OK; that particular part of the behavior wasn't actually why I wrote this test, though.  Still, it could be added, either here or in another test specifically dedicated to testing that part.

Given that Chromium and the rest of WebKit behave differently on openDatabase, what's the right thing to do?  Write a test that behaves differently on one platform, but add it to the test expectations?  Test the behavior, but accept either result?  Other?
------- Comment #7 From 2010-03-26 13:00:39 PST -------
(In reply to comment #6)
> Given that Chromium and the rest of WebKit behave differently on openDatabase,
> what's the right thing to do?  Write a test that behaves differently on one
> platform, but add it to the test expectations?  Test the behavior, but accept
> either result?  Other?

The normal way to do it is to have one test, and multiple sets of expected results.
------- Comment #8 From 2010-03-29 13:46:56 PST -------
(In reply to comment #7)
> (In reply to comment #6)
> > Given that Chromium and the rest of WebKit behave differently on openDatabase,
> > what's the right thing to do?  Write a test that behaves differently on one
> > platform, but add it to the test expectations?  Test the behavior, but accept
> > either result?  Other?
> 
> The normal way to do it is to have one test, and multiple sets of expected
> results.

That's the current state of this test, then?
If there's a prettier way to do it, just point me at an example and I'll switch it over.  If not, I'll close this bug as "as intended".
------- Comment #9 From 2010-03-29 14:16:56 PST -------
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > Given that Chromium and the rest of WebKit behave differently on openDatabase,
> > > what's the right thing to do?  Write a test that behaves differently on one
> > > platform, but add it to the test expectations?  Test the behavior, but accept
> > > either result?  Other?
> > 
> > The normal way to do it is to have one test, and multiple sets of expected
> > results.
> 
> That's the current state of this test, then?
> If there's a prettier way to do it, just point me at an example and I'll switch
> it over.  If not, I'll close this bug as "as intended".

David's pointed me to how it's done.  I'll upload a better fix.
------- Comment #10 From 2010-03-29 14:36:29 PST -------
(From update of attachment 51766 [details])
It sounds like we're going with a different way of addressing the issue.