use of com.facebook.fresco.vito.options.ImageOptions in project fresco by facebook.
the class HierarcherImplTest method testBuildErrorDrawable_whenNotSet_thenReturnNopDrawable.
@Test
public void testBuildErrorDrawable_whenNotSet_thenReturnNopDrawable() {
ImageOptions options = ImageOptions.create().build();
Drawable errorDrawable = mHierarcher.buildErrorDrawable(mResources, options);
assertThat(errorDrawable).isNull();
}
use of com.facebook.fresco.vito.options.ImageOptions in project fresco by facebook.
the class ImagePipelineUtilsImplTest method testBuildImageRequest_whenNoRoundingOptions_thenDoNotRound.
@Test
public void testBuildImageRequest_whenNoRoundingOptions_thenDoNotRound() {
final ImageOptions imageOptions = ImageOptions.create().build();
ImageRequest imageRequest = mImagePipelineUtils.buildImageRequest(URI, imageOptions);
assertThat(imageRequest).isNotNull();
assertThat(imageRequest.getSourceUri()).isEqualTo(URI);
assertThat(imageRequest.getImageDecodeOptions()).isEqualTo(ImageDecodeOptions.defaults());
}
use of com.facebook.fresco.vito.options.ImageOptions in project fresco by facebook.
the class ImagePipelineUtilsImplTest method testBuildImageRequest_whenRoundAsCircleAndRoundingDisabled_thenDoNothing.
@Test
public void testBuildImageRequest_whenRoundAsCircleAndRoundingDisabled_thenDoNothing() {
final ImageOptions imageOptions = ImageOptions.create().round(RoundingOptions.asCircle()).build();
ImageRequest imageRequest = mImagePipelineUtilsNoNativeRounding.buildImageRequest(URI, imageOptions);
assertThat(imageRequest).isNotNull();
assertThat(imageRequest.getSourceUri()).isEqualTo(URI);
ImageDecodeOptions imageDecodeOptions = imageRequest.getImageDecodeOptions();
assertThat(imageDecodeOptions).isEqualTo(ImageDecodeOptions.defaults());
}
use of com.facebook.fresco.vito.options.ImageOptions in project fresco by facebook.
the class ImagePipelineUtilsImplTest method testBuildImageRequest_whenRoundAsCircleWithAntiAliasingAndRoundingDisabled_thenDoNothing.
@Test
public void testBuildImageRequest_whenRoundAsCircleWithAntiAliasingAndRoundingDisabled_thenDoNothing() {
final ImageOptions imageOptions = ImageOptions.create().round(RoundingOptions.asCircle(true)).build();
ImageRequest imageRequest = mImagePipelineUtilsNoNativeRounding.buildImageRequest(URI, imageOptions);
assertThat(imageRequest).isNotNull();
assertThat(imageRequest.getSourceUri()).isEqualTo(URI);
ImageDecodeOptions imageDecodeOptions = imageRequest.getImageDecodeOptions();
assertThat(imageDecodeOptions).isEqualTo(ImageDecodeOptions.defaults());
}
use of com.facebook.fresco.vito.options.ImageOptions in project fresco by facebook.
the class ImagePipelineUtilsImplTest method testBuildImageRequest_whenRoundAsCircle_thenApplyRoundingParameters.
@Test
public void testBuildImageRequest_whenRoundAsCircle_thenApplyRoundingParameters() {
final ImageOptions imageOptions = ImageOptions.create().round(RoundingOptions.asCircle()).build();
ImageRequest imageRequest = mImagePipelineUtils.buildImageRequest(URI, imageOptions);
assertThat(imageRequest).isNotNull();
assertThat(imageRequest.getSourceUri()).isEqualTo(URI);
ImageDecodeOptions imageDecodeOptions = imageRequest.getImageDecodeOptions();
assertThat(imageDecodeOptions).isEqualTo(mRoundingDecodeOptions);
}
Aggregations