use of com.facebook.imagepipeline.request.ImageRequest 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.imagepipeline.request.ImageRequest 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.imagepipeline.request.ImageRequest 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.imagepipeline.request.ImageRequest 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);
}
use of com.facebook.imagepipeline.request.ImageRequest in project fresco by facebook.
the class ImagePipelineUtilsImplTest method testBuildImageRequest_whenUriNull_thenReturnNull.
@Test
public void testBuildImageRequest_whenUriNull_thenReturnNull() {
ImageRequest imageRequest = mImagePipelineUtils.buildImageRequest(null, ImageOptions.defaults());
assertThat(imageRequest).isNull();
}
Aggregations