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

Commit a439013e authored by Fiona Campbell's avatar Fiona Campbell
Browse files

Migrate Dream Tests

- Migrate dream tests and dependencies
- Annotate @FlakyTest for 3 failing tests
- Created bugs for those.

Bug: 290763662
Test: atest DreamServiceTests

Change-Id: Iff4f5c9227e7c8ebd3ad956aefa0d94f8e93f6d8
parent a207b8dc
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -26,6 +26,32 @@
                 android:testOnly="true">
        <uses-library android:name="android.test.mock" android:required="true" />
        <uses-library android:name="android.test.runner" />

        <service
            android:name="com.android.server.dreams.TestDreamService"
            android:exported="false"
            android:label="Test Dream" >
            <intent-filter>
                <action android:name="android.service.dreams.DreamService" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data
                android:name="android.service.dream"
                android:resource="@xml/test_dream_metadata" />
        </service>

        <service
            android:name="com.android.server.dreams.TestDreamServiceWithInvalidSettings"
            android:exported="false"
            android:label="Test Dream" >
            <intent-filter>
                <action android:name="android.service.dreams.DreamService" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data
                android:name="android.service.dream"
                android:resource="@xml/test_dream_metadata_invalid" />
        </service>
    </application>

    <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+22 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "DreamServiceTests",
      "options": [
        {"include-filter": "com.android.server.dreams"},
        {"exclude-annotation": "android.platform.test.annotations.FlakyTest"},
        {"exclude-annotation": "androidx.test.filters.FlakyTest"},
        {"exclude-annotation": "org.junit.Ignore"}
      ]
    }
  ],
  "postsubmit": [
    {
      "name": "DreamServiceTests",
      "options": [
        {"include-filter": "com.android.server.dreams"},
        {"exclude-annotation": "org.junit.Ignore"}
      ]
    }
  ]
}
+2 −1
Original line number Diff line number Diff line
@@ -15,5 +15,6 @@
  -->

<dream xmlns:android="http://schemas.android.com/apk/res/android"
       android:settingsActivity="com.android.frameworks.servicestests/.TestDreamSettingsActivity"
       android:settingsActivity=
           "com.android.frameworks.dreamservicetests/.TestDreamSettingsActivity"
       android:showClockAndComplications="false" />
+3 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import android.os.RemoteException;
import android.os.test.TestLooper;
import android.service.dreams.IDreamService;

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

@@ -231,6 +232,7 @@ public class DreamControllerTest {
    }

    @Test
    @FlakyTest(bugId = 293109503)
    public void serviceDisconnect_resetsScreenTimeout() throws RemoteException {
        // Start dream.
        mDreamController.startDream(mToken, mDreamName, false /*isPreview*/, false /*doze*/,
@@ -250,6 +252,7 @@ public class DreamControllerTest {
    }

    @Test
    @FlakyTest(bugId = 293109503)
    public void binderDied_resetsScreenTimeout() throws RemoteException {
        // Start dream.
        mDreamController.startDream(mToken, mDreamName, false /*isPreview*/, false /*doze*/,
Loading