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

Commit aa5070f7 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "Adding an annotation for tests that change nothing on screen and may...

Merge "Adding an annotation for tests that change nothing on screen and may produce no view capture data" into main
parents 6ebfd954 ec072e08
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.util.LauncherBindableItemsContainer.ItemOperator;
import com.android.launcher3.util.rule.ViewCaptureRule;

import org.junit.After;
import org.junit.Test;
@@ -95,6 +96,7 @@ public class PromiseIconUiTest extends AbstractLauncherUiTest {
    }

    @Test
    @ViewCaptureRule.MayProduceNoFrames
    public void testPromiseIcon_notAddedFromIneligibleSession() throws Throwable {
        final String appLabel = "Test Promise App " + UUID.randomUUID().toString();
        final ItemOperator findPromiseApp = (info, view) ->
+7 −1
Original line number Diff line number Diff line
@@ -132,7 +132,9 @@ class ViewCaptureRule(var alreadyOpenActivitySupplier: Supplier<Activity?>) : Te
        for (i in 0 until viewCaptureData!!.windowDataCount) {
            frameCount += viewCaptureData!!.getWindowData(i).frameDataCount
        }
        assertTrue("Empty ViewCapture data", frameCount > 0)

        val mayProduceNoFrames = description.getAnnotation(MayProduceNoFrames::class.java) != null
        assertTrue("Empty ViewCapture data", mayProduceNoFrames || frameCount > 0)

        val anomalies: Map<String, String> = ViewCaptureAnalyzer.getAnomalies(viewCaptureData)
        if (!anomalies.isEmpty()) {
@@ -159,4 +161,8 @@ class ViewCaptureRule(var alreadyOpenActivitySupplier: Supplier<Activity?>) : Te
            )
        }
    }

    @Retention(AnnotationRetention.RUNTIME)
    @Target(AnnotationTarget.FUNCTION)
    annotation class MayProduceNoFrames
}