Update screebshot diff tests to make the tests more stable.

Test: presubmit
Bug: 256770697
Change-Id: Iad890d7fd11c1e1f032e8839ac9b57c656f790cd
This commit is contained in:
Kelly
2022-12-13 15:47:38 +08:00
parent 77d5ee10de
commit bf1dd10fe9
96 changed files with 25 additions and 25 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

View File

@@ -34,7 +34,7 @@ class ActionButtonsScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule

View File

@@ -32,7 +32,7 @@ class BarChartScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule

View File

@@ -33,7 +33,7 @@ class LineChartScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule

View File

@@ -31,7 +31,7 @@ class PieChartScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule

View File

@@ -31,7 +31,7 @@ class ImageIllustrationScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule

View File

@@ -16,10 +16,10 @@
package com.android.settingslib.spa.screenshot
import androidx.compose.foundation.layout.Column
import com.android.settingslib.spa.framework.compose.stateOf
import com.android.settingslib.spa.widget.preference.MainSwitchPreference
import com.android.settingslib.spa.widget.preference.SwitchPreferenceModel
import com.android.settingslib.spa.widget.scaffold.RegularScaffold
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -32,7 +32,7 @@ class MainSwitchPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule
@@ -45,7 +45,7 @@ class MainSwitchPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
@Test
fun test() {
screenshotRule.screenshotTest("mainSwitchPreference") {
RegularScaffold(title = "MainSwitchPreference") {
Column {
MainSwitchPreference(
object : SwitchPreferenceModel {
override val title = "MainSwitchPreference"

View File

@@ -16,6 +16,7 @@
package com.android.settingslib.spa.screenshot
import androidx.compose.foundation.layout.Column
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Autorenew
import androidx.compose.material.icons.outlined.DisabledByDefault
@@ -23,7 +24,6 @@ import androidx.compose.runtime.Composable
import com.android.settingslib.spa.framework.compose.toState
import com.android.settingslib.spa.widget.preference.Preference
import com.android.settingslib.spa.widget.preference.PreferenceModel
import com.android.settingslib.spa.widget.scaffold.RegularScaffold
import com.android.settingslib.spa.widget.ui.SettingsIcon
import org.junit.Rule
import org.junit.Test
@@ -37,7 +37,7 @@ class PreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
private const val TITLE = "Title"
private const val SUMMARY = "Summary"
private const val LONG_SUMMARY =
@@ -54,7 +54,7 @@ class PreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
@Test
fun test() {
screenshotRule.screenshotTest("preference") {
RegularScaffold(title = "Preference") {
Column {
Preference(object : PreferenceModel {
override val title = TITLE
})

View File

@@ -16,6 +16,7 @@
package com.android.settingslib.spa.screenshot
import androidx.compose.foundation.layout.Column
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.SystemUpdate
@@ -23,7 +24,6 @@ import androidx.compose.runtime.Composable
import com.android.settingslib.spa.widget.preference.ProgressBarPreference
import com.android.settingslib.spa.widget.preference.ProgressBarPreferenceModel
import com.android.settingslib.spa.widget.preference.ProgressBarWithDataPreference
import com.android.settingslib.spa.widget.scaffold.RegularScaffold
import com.android.settingslib.spa.widget.ui.CircularProgressBar
import org.junit.Rule
import org.junit.Test
@@ -37,7 +37,7 @@ class ProgressBarPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule
@@ -50,7 +50,7 @@ class ProgressBarPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
@Test
fun test() {
screenshotRule.screenshotTest("progressBar") {
RegularScaffold(title = "ProgressBar") {
Column {
LargeProgressBar()
SimpleProgressBar()
ProgressBarWithData()

View File

@@ -16,11 +16,11 @@
package com.android.settingslib.spa.screenshot
import androidx.compose.foundation.layout.Column
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.AccessAlarm
import com.android.settingslib.spa.widget.preference.SliderPreference
import com.android.settingslib.spa.widget.preference.SliderPreferenceModel
import com.android.settingslib.spa.widget.scaffold.RegularScaffold
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -33,7 +33,7 @@ class SliderPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule
@@ -46,7 +46,7 @@ class SliderPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
@Test
fun test() {
screenshotRule.screenshotTest("slider") {
RegularScaffold(title = "Slider") {
Column {
SliderPreference(object : SliderPreferenceModel {
override val title = "Simple Slider"
override val initValue = 40

View File

@@ -16,13 +16,13 @@
package com.android.settingslib.spa.screenshot
import androidx.compose.foundation.layout.Column
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.AirplanemodeActive
import androidx.compose.runtime.Composable
import com.android.settingslib.spa.framework.compose.stateOf
import com.android.settingslib.spa.widget.preference.SwitchPreference
import com.android.settingslib.spa.widget.preference.SwitchPreferenceModel
import com.android.settingslib.spa.widget.scaffold.RegularScaffold
import com.android.settingslib.spa.widget.ui.SettingsIcon
import org.junit.Rule
import org.junit.Test
@@ -36,7 +36,7 @@ class SwitchPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule
@@ -49,7 +49,7 @@ class SwitchPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec) {
@Test
fun test() {
screenshotRule.screenshotTest("switchPreference") {
RegularScaffold(title = "SwitchPreference") {
Column {
SampleSwitchPreference()
SampleSwitchPreferenceWithSummary()
SampleNotChangeableSwitchPreference()

View File

@@ -16,10 +16,10 @@
package com.android.settingslib.spa.screenshot
import androidx.compose.foundation.layout.Column
import com.android.settingslib.spa.framework.compose.stateOf
import com.android.settingslib.spa.widget.preference.TwoTargetSwitchPreference
import com.android.settingslib.spa.widget.preference.SwitchPreferenceModel
import com.android.settingslib.spa.widget.scaffold.RegularScaffold
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -32,7 +32,7 @@ class TwoTargetSwitchPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule
@@ -45,7 +45,7 @@ class TwoTargetSwitchPreferenceScreenshotTest(emulationSpec: DeviceEmulationSpec
@Test
fun test() {
screenshotRule.screenshotTest("twoTargetSwitchPreference") {
RegularScaffold(title = "TwoTargetSwitchPreference") {
Column {
TwoTargetSwitchPreference(object : SwitchPreferenceModel {
override val title = "TwoTargetSwitchPreference"
override val checked = stateOf(false)

View File

@@ -29,7 +29,7 @@ class FooterScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule

View File

@@ -29,7 +29,7 @@ class SpinnerScreenshotTest(emulationSpec: DeviceEmulationSpec) {
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletFull
fun getTestSpecs() = DeviceEmulationSpec.PhoneAndTabletMinimal
}
@get:Rule