org.robolectric.shadows.ShadowCookieManager Maven / Gradle / Ivy
package org.robolectric.shadows;
import android.webkit.CookieManager;
import android.webkit.RoboCookieManager;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.Resetter;
/**
* Shadow for {@code android.webkit.CookieManager}.
*/
@Implements(CookieManager.class)
public class ShadowCookieManager {
private static RoboCookieManager cookieManager;
private boolean flushed;
@Resetter
public static void resetCookies() {
cookieManager = null;
}
@Implementation
public static CookieManager getInstance() {
if (cookieManager == null) {
cookieManager = new RoboCookieManager();
}
return cookieManager;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy