Initialize the network process with cookie accept policy, persistent storage path and type. Use WebContext::sendToNetworkingProcessRelaunchingIfNecessary instead of WebContext::sendToAllProcessesRelaunchingThemIfNecessary to send SetCookiePersistentStorage message.
Created attachment 218962 [details] Patch
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
Created attachment 218963 [details] Patch
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 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 on attachment 218963 [details] Patch Clearing flags on attachment: 218963 Committed r161112: <http://trac.webkit.org/changeset/161112>
All reviewed patches have been landed. Closing bug.