Add basic tests for WebEnginePartCookieJar
Summary:
Currently, this only tests that cookies are correctly added to
KCookieServer in response to the QWebEngineCookieStore::cookieAdded
signal.
There are some limitations:
- ideally, to test the correct behaviour of WebEnginePartCookieJar::cookieAdded, one should call QWebEngineCookieStore::setCookie, so that QWebEngineCookieStore processes the cookie and emits the cookieAdded signal as it would in the real application. Unfortunately, in the tests, calling setCookie doesn't trigger the cookieAdded signal. Because of this, I manually emitted the signal. However, this bypasses any processing by the cookie store (such as calling QNetworkCookie::normalize, which I do manually);
- I don't know how to start a separate instance of the Cookie Server service, so the tests use the default one. This has two drawbacks: it's impossible to start with a clean state and the tests pollute the user's configuration (this second issue could be avoided by adding clean up code to each test)
Reviewers: dfaure
Reviewed By: dfaure
Differential Revision: https://phabricator.kde.org/D15381