Bug 138826 - [GTK] Add API to create a WebKitWebContext
Summary: [GTK] Add API to create a WebKitWebContext
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks: 138828
  Show dependency treegraph
 
Reported: 2014-11-18 02:37 PST by Carlos Garcia Campos
Modified: 2014-11-18 06:19 PST (History)
3 users (show)

See Also:


Attachments
Patch (74.06 KB, patch)
2014-11-18 03:10 PST, Carlos Garcia Campos
gustavo: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2014-11-18 02:37:30 PST
We have always used a default web context without providing API to create others. The main reason was that nobody requested it and we haven't needed it either. The main problem of the default web context is that you can't configure anything during construction. This hasn't been a problem so far because all the web context configuration we expose in the API can be configured after construction. But now we need to expose API to allow the user to configure the local storage directory (see https://bugzilla.gnome.org/show_bug.cgi?id=738720), which is a construct only configuration. The default web context was also a problem for our unit tests, because sharing the same context made it difficult to ensure tests cases are independent to each other. So, I think it's time to allow the user to create web contexts or inherit from WebKitWebContext to create a new custom context.
Comment 1 Carlos Garcia Campos 2014-11-18 03:10:03 PST
Created attachment 241776 [details]
Patch

I've reworked all the unit tests to use a different web context making them independent to each other
Comment 2 Gustavo Noronha (kov) 2014-11-18 03:41:19 PST
Should we use a different context for each test? There is value in testing things in a more realistic fashion, that will show issues that happen when one thing happens after another?
Comment 3 Carlos Garcia Campos 2014-11-18 03:46:29 PST
(In reply to comment #2)
> Should we use a different context for each test? There is value in testing
> things in a more realistic fashion, that will show issues that happen when
> one thing happens after another?

If we need that, we should use the same test. So, if two tests need to use the same context, they could be merged, like we did with the favicon tests, for example. Are you thinking in any concrete test?
Comment 4 Gustavo Noronha (kov) 2014-11-18 05:04:40 PST
Comment on attachment 241776 [details]
Patch

Makes sense =)
Comment 5 Carlos Garcia Campos 2014-11-18 06:19:18 PST
Committed r176256: <http://trac.webkit.org/changeset/176256>