Bug 138826

Summary: [GTK] Add API to create a WebKitWebContext
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gustavo, pnormand, svillar
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 138828    
Attachments:
Description Flags
Patch gustavo: review+

Carlos Garcia Campos
Reported 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.
Attachments
Patch (74.06 KB, patch)
2014-11-18 03:10 PST, Carlos Garcia Campos
gustavo: review+
Carlos Garcia Campos
Comment 1 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
Gustavo Noronha (kov)
Comment 2 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?
Carlos Garcia Campos
Comment 3 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?
Gustavo Noronha (kov)
Comment 4 2014-11-18 05:04:40 PST
Comment on attachment 241776 [details] Patch Makes sense =)
Carlos Garcia Campos
Comment 5 2014-11-18 06:19:18 PST
Note You need to log in before you can comment on or make changes to this bug.