robolectric/robolectric — pull request #853 by benelog (2013-11-26 10:00:14+00:00)
Title: Reimplement ShadowCookieManager with org.apache.http.client.CookieStore

The ShadowCookieManager of ver 2.2 cannot support original behavior of android.webkit.CookieManager with attributes, 'Expires', 'Domain' and so on.

For example, a following test fails.

cookieManager.setCookie(httpUrl, "name=value; Expires=Wed, 11 Jul 2035 08:12:26 GMT");
assertThat(cookieManager.getCookie(httpUrl)).isEqualTo("name=value");

It can be a solution to use org.apache.http.client.CookieStore in the implementation.

I tested android.webkit.CookieManager with AndroidTestCase ( https://gist.github.com/benelog/7655764 ) , and ported the tests to 'ShadowCookieManagerTest'. Then I made new implementation of ShawdowCookieManager passing that tests.