Merge "Move flaky to single test level instead of class level"

This commit is contained in:
Yunfan Chen
2019-02-12 04:57:22 +00:00
committed by Android (Google) Code Review
17 changed files with 31 additions and 29 deletions

View File

@@ -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;

View File

@@ -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,

View File

@@ -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;

View File

@@ -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");

View File

@@ -24,7 +24,6 @@ import android.app.ActivityOptions;
import android.platform.test.annotations.Presubmit;
import android.view.RemoteAnimationAdapter;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import com.android.server.testutils.OffsettableClock;

View File

@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTrue;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.MediumTest;
import org.junit.After;

View File

@@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
import android.app.ActivityOptions;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.MediumTest;
import org.junit.Test;

View File

@@ -167,7 +167,6 @@ public class SurfaceAnimationRunnerTest extends WindowTestsBase {
verify(mMockAnimationSpec, atLeastOnce()).apply(any(), any(), eq(0L));
}
@FlakyTest(bugId = 74780584)
@Test
public void testDeferStartingAnimations() throws Exception {
mSurfaceAnimationRunner.deferStartingAnimations();

View File

@@ -34,7 +34,6 @@ import android.view.SurfaceControl.Builder;
import android.view.SurfaceControl.Transaction;
import android.view.SurfaceSession;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import com.android.server.wm.SurfaceAnimator.Animatable;
@@ -51,7 +50,7 @@ import org.mockito.MockitoAnnotations;
* Test class for {@link SurfaceAnimatorTest}.
*
* Build/Install/Run:
* atest FrameworksServicesTests:SurfaceAnimatorTest
* atest WmTests:SurfaceAnimatorTest
*/
@SmallTest
@Presubmit

View File

@@ -29,8 +29,6 @@ import android.os.UserManager;
import android.platform.test.annotations.Presubmit;
import android.util.SparseBooleanArray;
import androidx.test.filters.FlakyTest;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

View File

@@ -43,7 +43,6 @@ import org.junit.Test;
* Build/Install/Run:
* atest FrameworksServicesTests:TaskPositioningControllerTests
*/
@FlakyTest(bugId = 117924387)
@SmallTest
@Presubmit
public class TaskPositioningControllerTests extends WindowTestsBase {
@@ -90,6 +89,7 @@ public class TaskPositioningControllerTests extends WindowTestsBase {
assertNull(mTarget.getDragWindowHandleLocked());
}
@FlakyTest(bugId = 69229402)
@Test
public void testHandleTapOutsideTask() {
synchronized (mWm.mGlobalLock) {

View File

@@ -49,7 +49,7 @@ import org.junit.Test;
* Test class to for {@link android.app.WindowConfiguration}.
*
* Build/Install/Run:
* atest FrameworksServicesTests:WindowConfigurationTests
* atest WmTests:WindowConfigurationTests
*/
@SmallTest
@Presubmit

View File

@@ -26,7 +26,6 @@ import static org.junit.Assert.assertTrue;
import android.content.res.Configuration;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import org.junit.Test;
@@ -35,7 +34,7 @@ import org.junit.Test;
* Test class for {@link WindowContainerController}.
*
* Build/Install/Run:
* atest FrameworksServicesTests:WindowContainerControllerTests
* atest WmTests:WindowContainerControllerTests
*/
@SmallTest
@Presubmit

View File

@@ -47,7 +47,6 @@ import android.platform.test.annotations.Presubmit;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import org.junit.Test;
@@ -59,11 +58,10 @@ import java.util.Comparator;
* Test class for {@link WindowContainer}.
*
* Build/Install/Run:
* atest FrameworksServicesTests:WindowContainerTests
* atest WmTests:WindowContainerTests
*/
@SmallTest
@Presubmit
@FlakyTest(bugId = 74078662)
public class WindowContainerTests extends WindowTestsBase {
@Test

View File

@@ -28,7 +28,6 @@ import static org.junit.Assert.assertTrue;
import android.platform.test.annotations.Presubmit;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
import org.junit.Test;
@@ -37,7 +36,7 @@ import org.junit.Test;
* Tests for the {@link WindowToken} class.
*
* Build/Install/Run:
* atest FrameworksServicesTests:WindowTokenTests
* atest WmTests:WindowTokenTests
*/
@SmallTest
@Presubmit

View File

@@ -58,7 +58,7 @@ import java.nio.charset.StandardCharsets;
* Test class for {@link WindowTracing}.
*
* Build/Install/Run:
* atest FrameworksServicesTests:WindowTracingTest
* atest WmTests:WindowTracingTest
*/
@SmallTest
@Presubmit

View File

@@ -51,9 +51,8 @@ import java.util.LinkedList;
* Tests for the {@link DisplayContent#assignChildLayers(SurfaceControl.Transaction)} method.
*
* Build/Install/Run:
* atest FrameworksServicesTests:ZOrderingTests
* atest WmTests:ZOrderingTests
*/
@FlakyTest(bugId = 74078662)
@SmallTest
@Presubmit
public class ZOrderingTests extends WindowTestsBase {
@@ -207,6 +206,7 @@ public class ZOrderingTests extends WindowTestsBase {
return createWindow(null, TYPE_BASE_APPLICATION, mDisplayContent, name);
}
@FlakyTest(bugId = 124088319)
@Test
public void testAssignWindowLayers_ForImeWithNoTarget() {
mDisplayContent.mInputMethodTarget = null;
@@ -224,6 +224,7 @@ public class ZOrderingTests extends WindowTestsBase {
assertWindowHigher(mImeDialogWindow, mImeWindow);
}
@FlakyTest(bugId = 124088319)
@Test
public void testAssignWindowLayers_ForImeWithAppTarget() {
final WindowState imeAppTarget = createWindow("imeAppTarget");
@@ -243,6 +244,7 @@ public class ZOrderingTests extends WindowTestsBase {
assertWindowHigher(mImeDialogWindow, mImeWindow);
}
@FlakyTest(bugId = 124088319)
@Test
public void testAssignWindowLayers_ForImeWithAppTargetWithChildWindows() {
final WindowState imeAppTarget = createWindow("imeAppTarget");
@@ -269,6 +271,7 @@ public class ZOrderingTests extends WindowTestsBase {
assertWindowHigher(mImeDialogWindow, mImeWindow);
}
@FlakyTest(bugId = 124088319)
@Test
public void testAssignWindowLayers_ForImeWithAppTargetAndAppAbove() {
final WindowState appBelowImeTarget = createWindow("appBelowImeTarget");
@@ -292,6 +295,7 @@ public class ZOrderingTests extends WindowTestsBase {
assertWindowHigher(mImeDialogWindow, mImeWindow);
}
@FlakyTest(bugId = 124088319)
@Test
public void testAssignWindowLayers_ForImeNonAppImeTarget() {
final WindowState imeSystemOverlayTarget = createWindow(null, TYPE_SYSTEM_OVERLAY,
@@ -319,6 +323,7 @@ public class ZOrderingTests extends WindowTestsBase {
assertWindowHigher(mImeDialogWindow, mImeWindow);
}
@FlakyTest(bugId = 124088319)
@Test
public void testAssignWindowLayers_ForStatusBarImeTarget() {
mDisplayContent.mInputMethodTarget = mStatusBarWindow;
@@ -333,6 +338,7 @@ public class ZOrderingTests extends WindowTestsBase {
assertWindowHigher(mImeDialogWindow, mImeWindow);
}
@FlakyTest(bugId = 124088319)
@Test
public void testStackLayers() {
final WindowState anyWindow1 = createWindow("anyWindow");
@@ -398,6 +404,7 @@ public class ZOrderingTests extends WindowTestsBase {
assertWindowHigher(mediaOverlayChild, child);
}
@FlakyTest(bugId = 124088319)
@Test
public void testDockedDividerPosition() {
final WindowState pinnedStackWindow = createWindowOnStack(null, WINDOWING_MODE_PINNED,