Modern Apps git

← Modern-Apps.git

maps: slice 1/3 second-pass tests for surface, rail, streetview

Commit
b4910f98db2563975f98547c606a61e1e3922c1f
Author
Vayun Mathur <[email protected]>
When
2026-11-07 08:33 UTC (29 days ago)
Parents
615dd33
Slice coverage (merged INSTRUCTION over map/nav/google/
streetview/transit/theme/settings classes):
72.9% -> 86.3% (21816/25279 at first measurement).

New tests (11 files, all Slice1Pass2-named):
- Slice1Pass2RailGeometryTest: rail lane-count ramp, lane
  offsets, meters-per-dp, polyline fanning (bends, degenerate
  segments), and the settled-camera refresh decision matrix.
- Slice1Pass2StylePatchTest: the dark basemap palette through
  patchStyleForHybrid - every layer-id colour rule (casing
  before highway), label-family text/halo splits, suppressed
  POI layer, paint preservation.
- Slice1Pass2EffectsComposeTest: vehicle-loop ticks below the
  zoom gate and with no stop, rail CLEAR/REFETCH settle paths,
  traffic-prefetch zoom gate, follow camera heading-up /
  north-up / not-following.
- Slice1Pass2ComposeScreensTest: ElevationChart profiles
  (incl. degenerate), pegman drag lifecycle, Street View
  unavailable/sphere/attribution states, waypoint removal.
- Slice1Pass2InitialCameraTest: cold-start seed (device cache
  over persisted fix, zero-zero rejection) and one-shot
  centering on the first live fix via ShadowLocationManager.
- Slice1Pass2MapSurfaceProbeTest: MapSurface itself composed
  (bare and with route/pins/all layers) - the Vulkan renderer
  cannot present in the sandbox, but the surface wiring is
  ordinary Compose and now covered.
- Slice1Pass2ProbesTest: traffic prefetch over a real viewport
  (host native), transit/drive/walk overlay colours and
  travelled greying through the public overlay builder.
- Slice1Pass2NavComposeTest: maneuver banner with shield +
  then-peek + lanes, speed-widget limit/over-limit states,
  ElevationChart drawn under a real activity window.
- Slice1Pass2SettingsTest: overlay status line (pending /
  applied / current), saved-places re-tap, voice switch.
- Slice1Pass2StreetViewLoadTest: seam-default refusals against
  loopback, panorama tile stitching (full, failed, partial
  grids), nearest/byPano negative caching.
- Slice1Pass2ReviewsFetchTest: WebReviewsFetcher with a valid
  cid walks its WebView load/settle path and times out to null
  (45s sandbox scrape timeout; nothing is fetched).

No test touches the real network (loopback refusals and seam
fakes only), per the pass-3 CI note. No production code
changed; no bugs found.
Verified: gslot ./gradlew :maps:createMergedCoverageReport
(slice suite green, >85% merged slice instructions).

(cherry picked from commit e98b214a373aac8def4ed96992d94dce61b5d94d)

Diff

maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2ProbesTest.kt
diff --git a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2ProbesTest.kt b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2ProbesTest.ktindex 2993259ee2..95247bd528 100644--- a/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2ProbesTest.kt+++ b/maps/src/test/java/com/vayunmathur/maps/ui/map/Slice1Pass2ProbesTest.kt@@ -3,12 +3,9 @@ package com.vayunmathur.maps.ui.map import androidx.compose.ui.graphics.Color import com.vayunmathur.library.map.GeoBounds import com.vayunmathur.library.map.GeoPoint-import com.vayunmathur.maps.data.transit.TransitousDataSource import com.vayunmathur.maps.ui.theme.mapTokens import com.vayunmathur.maps.util.NavigationProgress import com.vayunmathur.maps.util.RouteService-import kotlinx.coroutines.runBlocking-import kotlinx.coroutines.withTimeoutOrNull import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import kotlin.test.Test@@ -21,8 +18,8 @@ import kotlin.time.Duration.Companion.minutes /**  * Slice 1/3 second pass (maps): native-adjacent probes and route-overlay  * colour decisions the first pass left — traffic prefetch over a real- * viewport, the transit board's live seam failure, and transit line- * colours (valid, blank, malformed) through the public overlay builder.+ * viewport and transit line colours (valid, blank, malformed)+ * through the public overlay builder.  */ @RunWith(RobolectricTestRunner::class) class Slice1Pass2ProbesTest {@@ -37,16 +34,6 @@ class Slice1Pass2ProbesTest {         prefetchTrafficSquares(GeoBounds(west = 10.0, south = 50.0, east = 9.0, north = 49.0))     } -    @Test-    fun `transit departures with the live seam degrade to empty offline`() = runBlocking {-        // unique stop id so no earlier cached failure/success can answer-        val deps = withTimeoutOrNull(30_000) {-            TransitousDataSource.departures("pass2-probe-${System.nanoTime()}")-        }-        // offline sandbox: the live seam fails and the board is empty, never a throw-        assertTrue(deps?.isEmpty() == true)-    }-     private fun transitStep(color: String?) = RouteService.Step(         distanceMeters = 100.0,         staticDuration = 1.minutes,