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

Commit 6a9ee51e authored by Mike Schneider's avatar Mike Schneider Committed by Android (Google) Code Review
Browse files

Merge "Fold [GoldenImagePathManager] into [GoldenPathManager] #cleanup" into main

parents 34e18a15 0a20da74
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -18,21 +18,21 @@ package com.android.credentialmanager

import android.os.Build
import androidx.test.platform.app.InstrumentationRegistry
import platform.test.screenshot.GoldenImagePathManager
import platform.test.screenshot.GoldenPathManager
import platform.test.screenshot.PathConfig

/** The assets path to be used by all CredentialManager screenshot tests. */
private const val ASSETS_PREFIX = "frameworks/base/packages/CredentialManager"
private const val ASSETS_PATH = "${ASSETS_PREFIX}/tests/robotests/screenshot/customization/assets"
private const val ASSETS_PATH_ROBO =
        "${ASSETS_PREFIX}/tests/robotests/customization/assets"
private const val ASSETS_PATH_ROBO = "${ASSETS_PREFIX}/tests/robotests/customization/assets"

private val isRobolectric = Build.FINGERPRINT.contains("robolectric")

class CredentialManagerGoldenImagePathManager(
class CredentialManagerGoldenPathManager(
    pathConfig: PathConfig,
    assetsPathRelativeToBuildRoot: String = if (isRobolectric) ASSETS_PATH_ROBO else ASSETS_PATH
) : GoldenImagePathManager(
) :
    GoldenPathManager(
        appContext = InstrumentationRegistry.getInstrumentation().context,
        assetsPathRelativeToBuildRoot = assetsPathRelativeToBuildRoot,
        deviceLocalPath =
@@ -46,6 +46,6 @@ class CredentialManagerGoldenImagePathManager(
    override fun toString(): String {
        // This string is appended to all actual/expected screenshots on the device, so make sure
        // it is a static value.
        return "CredentialManagerGoldenImagePathManager"
        return "CredentialManagerGoldenPathManager"
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ class GetCredScreenshotTest(emulationSpec: DeviceEmulationSpec) {
    @get:Rule
    val screenshotRule = ComposeScreenshotTestRule(
            emulationSpec,
            CredentialManagerGoldenImagePathManager(getEmulatedDevicePathConfig(emulationSpec))
            CredentialManagerGoldenPathManager(getEmulatedDevicePathConfig(emulationSpec))
    )

    @get:Rule val setFlagsRule: SetFlagsRule = SetFlagsRule()
+10 −13
Original line number Diff line number Diff line
@@ -17,15 +17,12 @@
package com.android.settingslib.spa.screenshot.util

import androidx.test.platform.app.InstrumentationRegistry
import platform.test.screenshot.GoldenImagePathManager
import platform.test.screenshot.GoldenPathManager
import platform.test.screenshot.PathConfig

/** A [GoldenImagePathManager] that should be used for all Settings screenshot tests. */
class SettingsGoldenImagePathManager(
    pathConfig: PathConfig,
    assetsPathRelativeToBuildRoot: String
) :
    GoldenImagePathManager(
/** A [GoldenPathManager] that should be used for all Settings screenshot tests. */
class SettingsGoldenPathManager(pathConfig: PathConfig, assetsPathRelativeToBuildRoot: String) :
    GoldenPathManager(
        appContext = InstrumentationRegistry.getInstrumentation().context,
        assetsPathRelativeToBuildRoot = assetsPathRelativeToBuildRoot,
        deviceLocalPath =
@@ -39,6 +36,6 @@ class SettingsGoldenImagePathManager(
    override fun toString(): String {
        // This string is appended to all actual/expected screenshots on the device, so make sure
        // it is a static value.
        return "SettingsGoldenImagePathManager"
        return "SettingsGoldenPathManager"
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ class SettingsScreenshotTestRule(
    private val deviceEmulationRule = DeviceEmulationRule(emulationSpec)
    private val screenshotRule =
        ScreenshotTestRule(
            SettingsGoldenImagePathManager(
            SettingsGoldenPathManager(
                getEmulatedDevicePathConfig(emulationSpec),
                assetsPathRelativeToBuildRoot
            )
+16 −19
Original line number Diff line number Diff line
@@ -17,15 +17,12 @@
package com.android.input.screenshot

import androidx.test.platform.app.InstrumentationRegistry
import platform.test.screenshot.GoldenImagePathManager
import platform.test.screenshot.GoldenPathManager
import platform.test.screenshot.PathConfig

/** A [GoldenImagePathManager] that should be used for all Input screenshot tests. */
class InputGoldenImagePathManager(
        pathConfig: PathConfig,
        assetsPathRelativeToBuildRoot: String
) :
        GoldenImagePathManager(
/** A [GoldenPathManager] that should be used for all Input screenshot tests. */
class InputGoldenPathManager(pathConfig: PathConfig, assetsPathRelativeToBuildRoot: String) :
    GoldenPathManager(
        appContext = InstrumentationRegistry.getInstrumentation().context,
        assetsPathRelativeToBuildRoot = assetsPathRelativeToBuildRoot,
        deviceLocalPath =
@@ -39,6 +36,6 @@ class InputGoldenImagePathManager(
    override fun toString(): String {
        // This string is appended to all actual/expected screenshots on the device, so make sure
        // it is a static value.
        return "InputGoldenImagePathManager"
        return "InputGoldenPathManager"
    }
}
Loading