Add TestAPI to replace content on a display.
The current tests use MediaProjection to test that content is updated frame by frame. However, this causes several issues, like having to accept the permission dialog, having to wait for app launch animations to complete, content overlaying the test area. Instead, the tests only need to capture the window being tested. To do this, the test app creates a VirtualDisplay and then swaps the content of the display with a mirror of the window being tested. This way, the frames received in the VD only contain the content in the window mirror and nothing else on screen. This reduces the test time since we don't need to wait for a foreground service and the permission dialog to be clicked, nor does it have to wait for any animations to complete. The test can start as soon as the window is placed on screen and the VirtualDisplay contains the mirror. It also reduces flakes becuase there's no chance of other content showing over the test area so the pixels in the VD are deterministic. Test: SurfaceSyncGroupContinuousTest Test: ASurfaceControlBackPressureTest Test: SurfacePackageFlickerTest Test: AttachedSurfaceControlSyncTest Test: SurfaceViewSyncTest Test: SurfaceViewSyncContinuousTest Bug: 282169297 Bug: 288339794 Change-Id: I311a30f8e16b99034b9a662fe2755630d68fcb80
Loading
Please register or sign in to comment