Bug 135890

Summary: IndexedDB should respect SchemeRegistry's database access setting
Product: WebKit Reporter: Martin Hock <mhock>
Component: WebCore Misc.Assignee: Martin Hock <mhock>
Status: RESOLVED FIXED    
Severity: Normal CC: alecflett, ap, beidson, commit-queue, jonlee, jsbell
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
ap: review+
added test
ap: review+
cleaned up test none

Description Martin Hock 2014-08-13 11:18:49 PDT
As with WebSQL, IndexedDB should respect SchemeRegistry's database access setting in private browsing mode.
Comment 1 Martin Hock 2014-08-13 11:29:13 PDT
Created attachment 236537 [details]
patch
Comment 2 Martin Hock 2014-08-13 13:10:55 PDT
One of the mac-wk2 runs flaked on storage/indexeddb/mozilla/cursor-update-updates-indexes.html but mac-wk2 is running ML and this test is somewhat flaky there:
http://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=storage%2Findexeddb%2Fmozilla%2Fcursor-update-updates-indexes.html

I'll run it a few more times locally.
Comment 3 Alexey Proskuryakov 2014-08-13 13:28:20 PDT
Comment on attachment 236537 [details]
patch

Looks fine. I don't like the function name (isContextValid), but it wasn't particularly appropriate before this change either.

Please add a regression test ASAP (could be in a separate bug if this is urgent to land).
Comment 4 Martin Hock 2014-08-14 11:18:27 PDT
Created attachment 236604 [details]
added test
Comment 5 Alexey Proskuryakov 2014-08-14 12:44:09 PDT
Comment on attachment 236604 [details]
added test

View in context: https://bugs.webkit.org/attachment.cgi?id=236604&action=review

> LayoutTests/storage/indexeddb/private-browsing-affects-indexeddb.html:7
> +if (window.testRunner) {
> +    testRunner.dumpAsText();
> +}

You could have used js-test harness to get this and logging for free.

> LayoutTests/storage/indexeddb/private-browsing-affects-indexeddb.html:23
> +    if (!indexedDB.open('test1')) {
> +        log("Could not open test IndexedDB, exiting test.");
> +        return;
> +    }

I'm not sure if this is useful. We have all the other tests to verify that IndexedDB works, and dynamic changes to private browsing mode are not really meaningful.
Comment 6 Martin Hock 2014-08-14 13:52:29 PDT
Created attachment 236616 [details]
cleaned up test
Comment 7 Martin Hock 2014-08-14 14:05:08 PDT
Committed r172603: <http://trac.webkit.org/changeset/172603>