Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a70f110 authored by PETER LIANG's avatar PETER LIANG Committed by Automerger Merge Worker
Browse files

Merge "Fixing the SettingsRoboTest failure of the AnimatedImagePreference."...

Merge "Fixing the SettingsRoboTest failure of the AnimatedImagePreference." into sc-dev am: a458f9cd am: b265fa23

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15064551

Change-Id: Ib8cade1bb87c52386327e17d62c0e6b840017d07
parents f02c0e2d b265fa23
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -32,8 +32,7 @@ import android.graphics.drawable.AnimatedImageDrawable;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.graphics.drawable.AnimationDrawable;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.preference.PreferenceViewHolder;
@@ -45,6 +44,7 @@ import com.airbnb.lottie.LottieAnimationView;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
import org.robolectric.RobolectricTestRunner;
@@ -57,10 +57,12 @@ import java.io.InputStream;
public class AnimatedImagePreferenceTest {
    private final Context mContext = RuntimeEnvironment.application;
    private Uri mImageUri;
    private View mRootView;
    private PreferenceViewHolder mViewHolder;
    private AnimatedImagePreference mAnimatedImagePreference;

    @Mock
    private ViewGroup mRootView;

    @Spy
    private ImageView mImageView;

@@ -68,9 +70,8 @@ public class AnimatedImagePreferenceTest {
    public void init() {
        MockitoAnnotations.initMocks(this);

        final LayoutInflater inflater = LayoutInflater.from(mContext);
        mRootView = spy(inflater.inflate(R.layout.preference_animated_image, /* root= */ null));
        mViewHolder = spy(PreferenceViewHolder.createInstanceForTests(mRootView));
        doReturn(new LottieAnimationView(mContext)).when(mRootView).findViewById(R.id.lottie_view);
        mImageView = spy(new ImageView(mContext));

        mAnimatedImagePreference = new AnimatedImagePreference(mContext);