[webkit-reviews] review granted: [Bug 28417] openDatabase() with empty version sets db version up incorrectly : [Attachment 41112] Proposed patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 30 13:03:24 PDT 2009


David Kilzer (ddkilzer) <ddkilzer at webkit.org> has granted Ben Murdoch
<benm at google.com>'s request for review:
Bug 28417: openDatabase() with empty version sets db version up incorrectly
https://bugs.webkit.org/show_bug.cgi?id=28417

Attachment 41112: Proposed patch
https://bugs.webkit.org/attachment.cgi?id=41112&action=review

------- Additional Comments from David Kilzer (ddkilzer) <ddkilzer at webkit.org>
> Index: LayoutTests/storage/open-database-set-empty-version.html
> ===================================================================
> --- LayoutTests/storage/open-database-set-empty-version.html	(revision 0)
> +++ LayoutTests/storage/open-database-set-empty-version.html	(revision 0)
> @@ -0,0 +1,26 @@
> +<html>
> +<head>
> +<script>
> +function runTest() {
> +    if (window.layoutTestController) {
> +	   layoutTestController.dumpAsText();
> +	   layoutTestController.clearAllDatabases();
> +    }
> +    
> +    try {	
> +	   var db = openDatabase('28417Test', '', 'Test for bug 28417:
openDatabase() with empty version sets db version up incorrectly', 0);
> +	   // The next openDatabase call should fail because the database
version was set to '' by the call above, and now we are expecting a different
version.
> +	   var db2 = openDatabase('28417Test', 'test', 'Test for bug 28417:
openDatabase() with empty version sets db version up incorrectly', 0);
> +    } catch (e) {
> +	   document.getElementById('result').innerHTML = 'SUCCESS, an exception
was thrown. ' + e;
> +    }

The "var db = ..." statement could be moved outside the try{} block in case it
generates an exception (although I suppose it's somewhat unlikely that it would
generate the same exception and make the test pass when it shouldn't).

Might be nice to close the databases when you're done with them, too, but not
necessary.

r=me


More information about the webkit-reviews mailing list