This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-13 21:27:42 -04:00
1 parent 5fd47421f9
commit aecd2ebe1d
852 files changed
+4844 -46144

No files matched your search

@@ -79,14 +79,11 @@ class FlathubFocusTest {
compose.waitForIdle()
val field = editText(root)!!
compose.runOnIdle {
// Keep a nonempty query, so clearing focus cannot simply dispose the search field.
// Whitespace skips the network search while retaining the field just like typed text.
field.setText(" ")
field.requestFocus()
assertTrue(field.isFocused)
}
compose.waitForIdle()
// Touching a card does not implicitly focus a Compose control or release an AndroidView.
compose.onNodeWithText("Datcord").performSemanticsAction(SemanticsActions.OnClick) { it() }
compose.onNodeWithText(context.getString(R.string.store_install)).assertExists()
compose.runOnIdle {
@@ -8,7 +8,6 @@ import org.junit.Assert.assertTrue
import org.junit.Test
class GamepadGeometryTest {
/** A foldable's unfolded panel (px) and density, as the gamepad gets it under a 16:9 game. */
private data class Panel(val name: String, val width: Int, val height: Int, val density: Float) {
val controlsHeight get() = height - SessionDisplay.unfoldedGameHeight(width, height)
}
@@ -68,7 +67,6 @@ class GamepadGeometryTest {
val right = b.getValue(Slot.RIGHT_MAIN)
assertEquals(panel.name, left.cy, right.cy, 0.5f)
assertEquals(panel.name, left.cx, panel.width - right.cx, 0.5f)
// In the bottom half of their side, nearer the corner than the second controls.
assertTrue(panel.name, left.cx < b.getValue(Slot.LEFT_SECOND).cx)
assertTrue(panel.name, left.cy > panel.controlsHeight / 2f)
}
@@ -77,8 +75,6 @@ class GamepadGeometryTest {
@Test fun middleButtonsKeepTheDeckOrder() {
for (panel in panels) {
val b = boxes(panel)
// View before Menu and Steam before QAM: left of it in a row or two by two, above it
// in a single column.
fun before(a: Slot, c: Slot) = b.getValue(a).let { x -> b.getValue(c).let { y ->
x.cx < y.cx - 0.5f || (kotlin.math.abs(x.cx - y.cx) <= 0.5f && x.cy < y.cy) } }
assertTrue(panel.name, before(Slot.VIEW, Slot.MENU))
@@ -10,7 +10,6 @@ class LiftSheetTest {
}
@Test fun theButtonKeeps16dpAboveIt() {
// A short pane: the edge comes down so the button riding it still clears the top by 16.
val top = sheetTop(150f, 56f, 16f, 3f)
assertEquals(41f, top, 0.01f)
assertEquals(16f, top + 3f - 56f / 2f, 0.01f)
@@ -31,7 +31,6 @@ class MotionTest {
Motion.refresh(context)
assertEquals(0f, Motion.scale, 0f)
assertEquals(0, Motion.ms(300))
// The app's toggle never writes Android's preference.
assertEquals(1.5f, Settings.Global.getFloat(context.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE), 0f)
SessionPrefs.setAnimationsEnabled(context, true)
Motion.refresh(context)
@@ -13,7 +13,6 @@ class PageExitTest {
}
@Test fun anotherPageSinks() {
// The GPU drivers row in Steam's settings opens Components over the same rail item.
assertEquals(PageExit.Sink, pageExit("steam", "components", PageLeave.Ordinary))
}
@@ -12,7 +12,6 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import java.io.File
/** What the in-app picker lists in a folder: every folder A-Z, then only the files asked for. */
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [33])
class PickListingTest {
@@ -21,7 +21,6 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
// Render the component without starting runtime services or installing the app crash handler.
@Config(sdk = [28], application = android.app.Application::class)
class PresetScaleTest {
@get:Rule val compose = createRobolectricComposeRule()
@@ -39,7 +38,6 @@ class PresetScaleTest {
}
}
val originalWidth = compose.onNodeWithTag("page-size").fetchSemanticsNode().boundsInRoot.width
// Notify changes driven by the test before asking Compose to become idle again.
compose.runOnIdle {
scale.intValue = 75
Snapshot.sendApplyNotifications()
@@ -9,11 +9,8 @@ import org.robolectric.Shadows.shadowOf
fun createRobolectricComposeRule() = createComposeRule().also {
val context = RuntimeEnvironment.getApplication()
// Register only in Robolectric, without adding a host activity to either APK variant.
shadowOf(context.packageManager).addActivityIfNotPresent(
ComponentName(context, ComponentActivity::class.java),
)
// Pure state tests can leave unapplied snapshots before a Compose host starts its snapshot
// manager. Apply them before the rule's initial idle check, which runs before the test body.
Snapshot.sendApplyNotifications()
}
@@ -4,13 +4,11 @@ import com.droiddeck.launcher.stores.Store
import org.junit.Assert.assertEquals
import org.junit.Test
/** A store's modes are Store, Library and Installed; Amazon has no catalog of its own, so no Store. */
class StoreTabsTest {
@Test fun storeLibraryInstalledAmazonWithoutStore() {
assertEquals(listOf("store", "library", "installed"), tabsFor(Store.GOG))
assertEquals(listOf("library", "installed"), tabsFor(Store.AMAZON))
assertEquals("library", tabFor(Store.AMAZON, "store"))
// An old saved All tab opens Library; Installed is a mode again.
assertEquals("library", tabFor(Store.GOG, "all"))
assertEquals("installed", tabFor(Store.EPIC, "installed"))
assertEquals("store", tabFor(Store.GOG, "store"))