IndexedDB: Update tests with "upgradeneeded" shim
Created attachment 153894 [details] Patch
As I mentioned over in https://bugs.webkit.org/show_bug.cgi?id=92037 another approach would be to shim the new "upgradeneeded" mechanism and update the tests directly. That way, when we land the new support we can simply drop the shim and the tests remain "pure" with no helpers in the way. This patch has the shim plus a handful of updated tests, for feedback. The shim isn't perfect but should handle nearly all of the tests. I think I prefer this approach.
Comment on attachment 153894 [details] Patch Attachment 153894 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13330263 New failing tests: storage/indexeddb/mozilla/cursor-mutation-objectstore-only.html fullscreen/video-controls-timeline.html storage/indexeddb/cursor-added-bug.html fast/loader/loadInProgress.html storage/indexeddb/create-and-remove-object-store.html storage/indexeddb/cursor-delete.html storage/indexeddb/cursor-advance.html storage/indexeddb/createObjectStore-null-name.html storage/indexeddb/mozilla/create-objectstore-null-name.html storage/indexeddb/mozilla/create-index-with-integer-keys.html storage/indexeddb/cursor-continue-validity.html storage/indexeddb/mozilla/create-index-unique.html http/tests/xmlhttprequest/zero-length-response.html http/tests/security/script-crossorigin-loads-correctly.html storage/indexeddb/mozilla/clear.html storage/indexeddb/basics.html storage/indexeddb/create-object-store-options.html fast/frames/cached-frame-counter.html storage/indexeddb/mozilla/add-twice-failure.html storage/indexeddb/createObjectStore-name-argument-required.html storage/indexeddb/cursor-continue.html storage/indexeddb/basics-workers.html fast/loader/unload-form-post-about-blank.html storage/indexeddb/mozilla/create-objectstore-basics.html storage/indexeddb/mozilla/bad-keypath.html storage/indexeddb/mozilla/cursor-mutation.html storage/indexeddb/mozilla/autoincrement-indexes.html
Created attachment 153960 [details] Archive of layout-test-results from gce-cr-linux-08 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: gce-cr-linux-08 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
(In reply to comment #4) > Created an attachment (id=153960) [details] > Archive of layout-test-results from gce-cr-linux-08 > > The attached test failures were seen while running run-webkit-tests on the chromium-ews. > Bot: gce-cr-linux-08 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid Oh, heh, the shim doesn't account for tests that don't use it. :) That should be easy - switch based on arguments.length.
One problem this reveals is that many tests which don't do a deleteDatabase() call will fail if run manually in the browser if they use the new open(name, version) style. The setVersion() call would always run regardless of whether the old version was equal to the new version, and a deleteAllObjectStores(db) would get the database to a clean state. The "upgradeneeded" event is not fired if the old and new versions match, so tests that rely on it firing will fail.
Created attachment 154148 [details] Patch
After chatting w/ dgrogan@, I think we should table this for now. Real "upgradeneeded" support will be landing very soon so the shim doesn't buy us much. dgrogan@ points out that not breaking existing code - as validated by our current tests - is a high priority. The patch will be useful for validating the "upgradeneeded" support, though, and we will want to drop setVersion() eventually. Maybe we can land these tests (w/o the shim) side-by-side with the existing tests?
The real upgradeneeded support is landing now, so this is moot. We'll want to re-port the tests eventually when setVersion goes away. In the mean time, it seems like moving to a common helper function is not anathema in the WebKit community so https://bugs.webkit.org/show_bug.cgi?id=92037 may come back from the dead.