
org.robolectric.shadows.ShadowCookieSyncManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import android.content.Context;
import android.webkit.CookieSyncManager;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.shadow.api.Shadow;
@Implements(CookieSyncManager.class)
public class ShadowCookieSyncManager extends ShadowWebSyncManager {
private static CookieSyncManager sRef;
@Implementation
public static synchronized CookieSyncManager createInstance(Context ctx) {
if (sRef == null) {
sRef = Shadow.newInstanceOf(CookieSyncManager.class);
}
return sRef;
}
@Implementation
public static CookieSyncManager getInstance() {
if (sRef == null) {
throw new IllegalStateException("createInstance must be called first");
}
return sRef;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy