/** * This normally needs to be able to invalidate the view/drawable but not for the test. */ @VisibleForTesting TextDelegate() { animationView = null; drawable = null; }
@VisibleForTesting LottieCompositionCache() { }
/** * The type map is static so that models of the same class share the same views across different * adapters. This is useful for view recycling when the adapter instance changes, or when there * are multiple adapters. For testing purposes though it is good to be able to clear the map so we * don't carry over values across tests. */ @VisibleForTesting void resetMapForTesting() { VIEW_TYPE_MAP.clear(); }
@VisibleForTesting protected static final String WEB_FORM_URL = "file:///android_asset/web_form.html";
@VisibleForTesting protected static final String KEY_IMAGE_DATA = "data";
@VisibleForTesting static Intent createResultData(String phoneNumber) { final Intent resultData = new Intent(); resultData.putExtra(KEY_PHONE_NUMBER, phoneNumber); return resultData; } }
@VisibleForTesting protected static Map<String, Object> makeItem(int forRow) { Map<String, Object> dataRow = Maps.newHashMap(); dataRow.put(ROW_TEXT, String.format(ITEM_TEXT_FORMAT, forRow)); dataRow.put(ROW_ENABLED, forRow == 1); return dataRow; }
class DeferredRequestCreator implements OnPreDrawListener, OnAttachStateChangeListener { private final RequestCreator creator; @VisibleForTesting final ImageView target; @VisibleForTesting @Nullable Callback callback;
@VisibleForTesting public static final List<String> COFFEE_PREPARATIONS = Arrays.asList("Espresso", "Latte", "Mocha", "Café con leche", "Cold brew"); @VisibleForTesting public static final String VALID_ENDING = "coffee";
@SuppressWarnings("NullAway") @VisibleForTesting RequestCreator() { this.picasso = null; this.data = new Request.Builder(null, 0, null); }
private static boolean debug = false; @VisibleForTesting static final Map<Class<?>, Constructor<? extends Unbinder>> BINDINGS = new LinkedHashMap<>();
@VisibleForTesting protected static final String ROW_TEXT = "ROW_TEXT"; @VisibleForTesting protected static final String ROW_ENABLED = "ROW_ENABLED"; @VisibleForTesting protected static final int NUMBER_OF_ITEMS = 100; @VisibleForTesting protected static final String ITEM_TEXT_FORMAT = "item: %d";
/** * Only called from test, creates and returns a new {@link SimpleIdlingResource}. */ @VisibleForTesting @NonNull public IdlingResource getIdlingResource() { if (mIdlingResource == null) { mIdlingResource = new SimpleIdlingResource(); } return mIdlingResource; } }
private float maxFrame = Integer.MAX_VALUE; @Nullable private LottieComposition composition; @VisibleForTesting protected boolean running = false;
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) @Nullable public String rewriteError(int code) {
@VisibleForTesting static Bitmap transformResult(Request data, Bitmap result, int exifOrientation) { int inWidth = result.getWidth();
@VisibleForTesting boolean equalsForTesting(DiffPayload that) { if (singleModel != null) {
/** Wrapper around System.currentTimeMillis so that we can test DoodleLogTimer. */ @VisibleForTesting static class LogClock { public long currentTimeMillis() { return System.currentTimeMillis(); } } }
@VisibleForTesting public void setComponent(AppComponent component) { this.component = component; } }
@VisibleForTesting public void setComponent(MyComponent component) { this.component = component; } }