Bug 125576 - [WK2][SOUP] Fix handling of cookies when network process is enabled
: [WK2][SOUP] Fix handling of cookies when network process is enabled
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: WebKit2
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To: Kwang Yul Seo
:
Depends on:
Blocks: 108832
  Show dependency treegraph
 
Reported: 2013-12-11 07:24 PST by Kwang Yul Seo
Modified: 2013-12-28 02:14 PST (History)
7 users (show)

See Also:


Attachments
Patch (10.87 KB, patch)
2013-12-11 07:26 PST, Kwang Yul Seo
no flags Details | Formatted Diff | Diff
Patch (8.50 KB, patch)
2013-12-11 07:30 PST, Kwang Yul Seo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kwang Yul Seo 2013-12-11 07:24:16 PST
Initialize the network process with cookie accept policy, persistent storage path and type. Use WebContext::sendToNetworkingProcessRelaunchingIfNecessary instead of WebContext::sendToAllProcessesRelaunchingThemIfNecessary to send SetCookiePersistentStorage message.
Comment 1 Kwang Yul Seo 2013-12-11 07:26:20 PST
Created attachment 218962 [details]
Patch
Comment 2 WebKit Commit Bot 2013-12-11 07:27:14 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Kwang Yul Seo 2013-12-11 07:30:00 PST
Created attachment 218963 [details]
Patch
Comment 4 Kwang Yul Seo 2013-12-11 07:37:22 PST
Unfortunately, TestCookieManager.cpp: still fails:

TEST: ./Tools/gtk/../../WebKitBuild/Release/Programs/WebKit2APITests/TestCookieManager... (pid=31499)
**
ERROR:../../Source/WebKit2/UIProcess/API/gtk/tests/TestCookieManager.cpp:191:void testCookieManagerAcceptPolicy(CookieManagerTest*, gconstpointer): assertion failed (g_strv_length(domains) == 2): (1 == 2)

Further investigation shows that:
    g_assert(test->hasDomain(kFirstPartyDomain)) -> fail
    g_assert(test->hasDomain(kThirdPartyDomain)) -> pass

It seems the test becomes flaky because we can pass testCookieManagerAcceptPolicy by simply reordering the test sequence by moving WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS case to the first.
Comment 5 Carlos Garcia Campos 2013-12-28 01:47:37 PST
Comment on attachment 218963 [details]
Patch

I've tried it here locally and it works for me:

$ Programs/WebKit2APITests/TestCookieManager 
/webkit2/WebKitCookieManager/accept-policy: OK
/webkit2/WebKitCookieManager/delete-cookies: OK
/webkit2/WebKitCookieManager/cookies-changed: OK
/webkit2/WebKitCookieManager/persistent-storage: OK

$ WEBKIT_USE_NETWORK_PROCESS=1 Programs/WebKit2APITests/TestCookieManager 
/webkit2/WebKitCookieManager/accept-policy: OK
/webkit2/WebKitCookieManager/delete-cookies: OK
/webkit2/WebKitCookieManager/cookies-changed: OK
/webkit2/WebKitCookieManager/persistent-storage: OK
Comment 6 WebKit Commit Bot 2013-12-28 02:14:34 PST
Comment on attachment 218963 [details]
Patch

Clearing flags on attachment: 218963

Committed r161112: <http://trac.webkit.org/changeset/161112>
Comment 7 WebKit Commit Bot 2013-12-28 02:14:37 PST
All reviewed patches have been landed.  Closing bug.