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

Commit 6e7043af authored by Oli Lan's avatar Oli Lan Committed by Android (Google) Code Review
Browse files

Merge "Fix AvatarPhotoControllerTest." into tm-dev

parents 8bed7fca 046d339d
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -89,6 +89,10 @@ public class AvatarPhotoControllerTest {

    @After
    public void tearDown() {
        String[] entries = mImagesDir.list();
        for (String entry : entries) {
            new File(mImagesDir, entry).delete();
        }
        mImagesDir.delete();
    }

@@ -233,7 +237,8 @@ public class AvatarPhotoControllerTest {
    public void internalCropUsedIfNoSystemCropperFound() throws IOException {
        when(mMockAvatarUi.startSystemActivityForResult(any(), anyInt())).thenReturn(false);

        new File(mImagesDir, "file.txt").createNewFile();
        File file = new File(mImagesDir, "file.txt");
        saveBitmapToFile(file);

        Intent intent = new Intent();
        intent.setData(Uri.parse(
@@ -241,10 +246,6 @@ public class AvatarPhotoControllerTest {
        mController.onActivityResult(
                REQUEST_CODE_TAKE_PHOTO, Activity.RESULT_OK, intent);

        Intent startIntent = verifyStartSystemActivityForResult(
                "com.android.camera.action.CROP", REQUEST_CODE_CROP_PHOTO);
        assertThat(startIntent.getData()).isNotEqualTo(mTakePhotoUri);

        verify(mMockAvatarUi, timeout(TIMEOUT_MILLIS)).returnUriResult(mCropPhotoUri);

        InputStream imageStream = mContext.getContentResolver().openInputStream(mCropPhotoUri);