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

Commit a04567dc authored by AI test gen's avatar AI test gen Committed by Derek Sollenberger
Browse files

Add unit test for WallpaperService.Engine#getRenderingSurfaceControl

Adds a unit test for the `getRenderingSurfaceControl` method to ensure it returns the expected initial value.


Please help fill out the survey for feedback: https://forms.gle/Qz9q5boo4h4tESyd7
Original Change: ag/35063715
Test: passed ABTD tests http://go/forrest-run/L57400030017258632
Bug: 431235865
Flag: TEST_ONLY

Change-Id: Iad99426f516cc7d0d2d899e363126872eb0354b3
parent a409f98e
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.service.wallpaper;

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

import androidx.test.filters.SmallTest;
@@ -98,4 +99,22 @@ public class WallpaperServiceTest {

        engine.notifyColorsChanged();
    }

    @Test
    public void testGetRenderingSurfaceControl() {
        WallpaperService service = new WallpaperService() {
            @Override
            public Engine onCreateEngine() {
                return new Engine();
            }
        };
        WallpaperService.Engine engine = service.onCreateEngine();

        // Before the engine's surface is created and updated, this field is expected to be null.
        // A full integration test would be required to verify the non-null case, as creating a
        // real SurfaceControl requires significant setup. This unit test verifies the getter's
        // basic functionality and initial state.
        assertNull("getRenderingSurfaceControl should return null before surface creation",
                engine.getRenderingSurfaceControl());
    }
}