@@ -0,0 +1,3017 @@
+package com.google.android.libraries.motionphotoreader;%0A%0Aimport android.graphics.Bitmap;%0Aimport android.media.MediaExtractor;%0Aimport android.os.Bundle;%0A%0Aimport androidx.test.espresso.ViewInteraction;%0Aimport androidx.test.ext.junit.runners.AndroidJUnit4;%0Aimport androidx.test.platform.app.InstrumentationRegistry;%0Aimport androidx.test.rule.ActivityTestRule;%0A%0Aimport com.adobe.internal.xmp.XMPException;%0Aimport com.google.common.io.ByteStreams;%0A%0Aimport org.junit.After;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.TemporaryFolder;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.stubbing.Answer;%0A%0Aimport java.io.File;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.lang.reflect.Field;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.concurrent.BlockingQueue;%0Aimport java.util.concurrent.LinkedBlockingQueue;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static androidx.test.espresso.Espresso.onView;%0Aimport static androidx.test.espresso.action.ViewActions.click;%0Aimport static androidx.test.espresso.assertion.ViewAssertions.matches;%0Aimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;%0Aimport static androidx.test.espresso.matcher.ViewMatchers.withId;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.ArgumentMatchers.anyInt;%0Aimport static org.mockito.ArgumentMatchers.anyLong;%0Aimport static org.mockito.ArgumentMatchers.eq;%0Aimport static org.mockito.Mockito.doAnswer;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0A%0A/**%0A * Instrumented test for MotionPhotoReader class.%0A */%0A@RunWith(AndroidJUnit4.class)%0Apublic class MotionPhotoWidgetTest %7B%0A    private static final String filename = %22MVIMG_20200621_200240.jpg%22;%0A    private static final int NUM_FRAMES = 44;%0A    private static final long SEEK_AMOUNT_US = 10_000L;%0A%0A    /** A list of opened motion photo readers to close afterwards. */%0A    private final List%3CRunnable%3E cleanup = new ArrayList%3C%3E();%0A%0A    @Rule%0A    public TemporaryFolder temporaryFolder = new TemporaryFolder();%0A%0A    @After%0A    public void tearDown() %7B%0A        for (Runnable r : cleanup) %7B%0A            r.run();%0A        %7D%0A        cleanup.clear();%0A    %7D%0A%0A    @Rule%0A    public ActivityTestRule%3CMainActivity%3E activityRule =%0A            new ActivityTestRule%3C%3E(MainActivity.class);%0A%0A    @Test%0A    public void widgetUI_surface_isPrepared() %7B%0A        ViewInteraction motionPhotoWidget = onView(withId(R.id.motion_photo_widget));%0A        motionPhotoWidget.perform(click()).check(matches(isDisplayed()));%0A    %7D%0A%0A    @Test%0A    public void widgetUI_onClick_pausesAndPlays() %7B%0A        ViewInteraction motionPhotoWidget = onView(withId(R.id.motion_photo_widget));%0A        motionPhotoWidget.perform(click());%0A    %7D%0A%7D

Add MotionPhotoWidget unit tests.