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

Commit d552c16b authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Move flaky to single test level instead of class level

This will promote more tests into pre-submit. The standard is, if a test
is shown stable in the past 7 days, the flaky is removed.

Some clean-up also applied.

Bug: 123654474
Test: pre-submit

Change-Id: I4d0563eae9e3e7db4e6cffb2630c5930865ae1aa
parent a4cceec0
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verifyNoMoreInteractions;

import static com.google.common.truth.Truth.assertWithMessage;

import static org.mockito.ArgumentMatchers.anyInt;
@@ -35,9 +36,7 @@ import android.content.Intent;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
import android.util.SparseIntArray;
import android.util.proto.ProtoOutputStream;

import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;

import com.android.server.wm.ActivityMetricsLaunchObserver.ActivityRecordProto;
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.view.RemoteAnimationAdapter;
import android.view.RemoteAnimationDefinition;
import android.view.RemoteAnimationTarget;

import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;

import org.junit.Before;
+6 −1
Original line number Diff line number Diff line
@@ -71,7 +71,6 @@ import java.util.concurrent.TimeUnit;
 *  atest WmTests:AssistDataRequesterTest
 */
@MediumTest
@FlakyTest(bugId = 113616538)
public class AssistDataRequesterTest extends ActivityTestsBase {

    private static final String TAG = AssistDataRequesterTest.class.getSimpleName();
@@ -154,6 +153,7 @@ public class AssistDataRequesterTest extends ActivityTestsBase {
                .checkOpNoThrow(eq(OP_ASSIST_SCREENSHOT), anyInt(), anyString());
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testRequestData() throws Exception {
        setupMocks(CURRENT_ACTIVITY_ASSIST_ALLOWED, CALLER_ASSIST_STRUCTURE_ALLOWED,
@@ -174,6 +174,7 @@ public class AssistDataRequesterTest extends ActivityTestsBase {
        assertReceivedDataCount(0, 0, 0, 0);
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testCurrentAppDisallow_expectNullCallbacks() throws Exception {
        setupMocks(!CURRENT_ACTIVITY_ASSIST_ALLOWED, CALLER_ASSIST_STRUCTURE_ALLOWED,
@@ -184,6 +185,7 @@ public class AssistDataRequesterTest extends ActivityTestsBase {
        assertReceivedDataCount(0, 1, 0, 1);
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testProcessPendingData() throws Exception {
        setupMocks(CURRENT_ACTIVITY_ASSIST_ALLOWED, CALLER_ASSIST_STRUCTURE_ALLOWED,
@@ -241,6 +243,7 @@ public class AssistDataRequesterTest extends ActivityTestsBase {
        assertReceivedDataCount(0, 1, 0, 1);
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testDisallowAssistContextExtras_expectNullDataCallbacks() throws Exception {
        setupMocks(CURRENT_ACTIVITY_ASSIST_ALLOWED, CALLER_ASSIST_STRUCTURE_ALLOWED,
@@ -254,6 +257,7 @@ public class AssistDataRequesterTest extends ActivityTestsBase {
        assertReceivedDataCount(0, 1, 0, 1);
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testNoFetchScreenshots_expectNoScreenshotCallbacks() throws Exception {
        setupMocks(CURRENT_ACTIVITY_ASSIST_ALLOWED, CALLER_ASSIST_STRUCTURE_ALLOWED,
@@ -264,6 +268,7 @@ public class AssistDataRequesterTest extends ActivityTestsBase {
        assertReceivedDataCount(5, 5, 0, 0);
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testDisallowAssistScreenshot_expectNullScreenshotCallback() throws Exception {
        setupMocks(CURRENT_ACTIVITY_ASSIST_ALLOWED, CALLER_ASSIST_STRUCTURE_ALLOWED,
+3 −5
Original line number Diff line number Diff line
@@ -19,11 +19,11 @@ package com.android.server.wm;
import static android.view.InsetsState.TYPE_TOP_BAR;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;

import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

import android.graphics.Insets;
import android.graphics.Rect;
@@ -31,8 +31,6 @@ import android.platform.test.annotations.Presubmit;
import android.view.InsetsSource;
import android.view.InsetsState;

import org.junit.Before;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;

import org.junit.Before;
+5 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import androidx.test.filters.SmallTest;
import org.junit.Test;

@SmallTest
@FlakyTest(detail = "Promote once confirmed non-flaky")
@Presubmit
public class InsetsStateControllerTest extends WindowTestsBase {

@@ -48,6 +47,7 @@ public class InsetsStateControllerTest extends WindowTestsBase {
        assertNotNull(getController().getInsetsForDispatch(app).getSource(TYPE_TOP_BAR));
    }

    @FlakyTest(bugId = 69229402)
    @Test
    public void testStripForDispatch_own() {
        final WindowState topBar = createWindow(null, TYPE_APPLICATION, "parentWindow");
@@ -57,6 +57,7 @@ public class InsetsStateControllerTest extends WindowTestsBase {
        assertEquals(new InsetsState(), getController().getInsetsForDispatch(topBar));
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testStripForDispatch_navBar() {
        final WindowState navBar = createWindow(null, TYPE_APPLICATION, "parentWindow");
@@ -68,6 +69,7 @@ public class InsetsStateControllerTest extends WindowTestsBase {
        assertEquals(new InsetsState(), getController().getInsetsForDispatch(navBar));
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testBarControllingWinChanged() {
        final WindowState navBar = createWindow(null, TYPE_APPLICATION, "parentWindow");
@@ -80,6 +82,7 @@ public class InsetsStateControllerTest extends WindowTestsBase {
        assertEquals(2, controls.length);
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testControlRevoked() {
        final WindowState topBar = createWindow(null, TYPE_APPLICATION, "parentWindow");
@@ -91,6 +94,7 @@ public class InsetsStateControllerTest extends WindowTestsBase {
        assertNull(getController().getControlsForDispatch(app));
    }

    @FlakyTest(bugId = 124088319)
    @Test
    public void testControlRevoked_animation() {
        final WindowState topBar = createWindow(null, TYPE_APPLICATION, "parentWindow");
Loading