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

Commit f9541469 authored by andrewxu's avatar andrewxu Committed by Andrew Xu
Browse files

Refactor SystemUITests module to help create SystemUITests_desktop

This CL creates SystemUITests_defaults, a java default module, by
refactoring the SystemUITests module.

SystemUITests_defaults is used to create SystemUITests_desktop
in ag/35157076

Note that SystemUITests_desktop depends on an overlay located under
google/desktop. Therefore, SystemUITests_desktop cannot be created
under frameworks/base. Otherwise, AOSP builds will be broken, as
reported in b/439667766

Patch set 9 is the reverted CL's change. Compared to the reverted
change, SystemUITests_desktop is not under frameworks/base anymore.

Bug: 438221449
Flag: TEST_ONLY
Change-Id: I126138143d68185826862d30926b9c37ea5cc74f
parent 259b7c0c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -171,6 +171,9 @@
  "desktop-presubmit": [
    {
      "name": "SystemUIGoogleScreenshotTests_desktop"
    },
    {
      "name": "SystemUITests_desktop"
    }
  ],

+19 −4
Original line number Diff line number Diff line
@@ -19,8 +19,18 @@ package {
    default_applicable_licenses: ["frameworks_base_packages_SystemUI_license"],
}

android_test {
    name: "SystemUITests",
filegroup {
    name: "systemui_tests_base_manifest",
    srcs: ["AndroidManifest-base.xml"],
}

filegroup {
    name: "systemui_tests_additional_manifest",
    srcs: ["AndroidManifest.xml"],
}

java_defaults {
    name: "SystemUITests_defaults",
    use_resource_processor: true,
    defaults: ["systemui-non-platform-apis-defaults"],
    dxflags: ["--multi-dex"],
@@ -47,8 +57,13 @@ android_test {
    // UI it doesn't own. This is necessary to allow screenshots to be taken
    certificate: "platform",

    additional_manifests: ["AndroidManifest.xml"],
    manifest: "AndroidManifest-base.xml",
    additional_manifests: [":systemui_tests_additional_manifest"],
    manifest: ":systemui_tests_base_manifest",
}

android_test {
    name: "SystemUITests",
    defaults: ["SystemUITests_defaults"],
}

test_module_config {
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.brightness.ui.compose

import android.content.res.Configuration
import android.platform.test.annotations.WithDesktopTest
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.runtime.CompositionLocalProvider
@@ -66,6 +67,7 @@ class BrightnessSliderTest : SysuiTestCase() {
    private var localeConfiguration by mutableStateOf(englishLocaleConfiguration)

    @Test
    @WithDesktopTest
    fun stateDescription_hasPercentage() {
        val value = 25
        val range = 0..200