cast: screenshot capture for the cast route, protocol fixture
- Commit
08f47d4a43496e7936b95c0950f6f759bdd17205- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-02 01:36 UTC (4 days ago)
- Parents
2f5425c
RouteScreenshotCoverage (1 fixed with a real capture, 0 exemptions): MetadataPreviews gains 5-cast rendering the stateless CastContent with the fixed receiver list, covering the module's only route. FixtureDeterminism (1 fixed in the :cast:protocol submodule): EphemeralTlsTest's certificate-freshness check hid Instant.now() on a continuation line of a multi-line assertTrue, escaping the detector's freshness-assert idiom; the assert now reads the clock on the assert line. This is a test-only change in cast/protocol, included here because :cast lint aggregates the protocol project's results; no wire or crypto code changes. Verified: ./gradlew :cast:lint :cast:lintVitalRelease :cast:testDevUnitTest :cast:compileReleaseKotlin :cast:compileDevScreenshotTestKotlin and :cast:protocol:lint :cast:protocol:testDebugUnitTest all green (EngineFeedbackTest failed once in a full run, passed on rerun and in isolation).
Diff
cast/protocol/src/test/java/com/vayunmathur/cast/protocol/EphemeralTlsTest.kt
diff --git a/cast/protocol/src/test/java/com/vayunmathur/cast/protocol/EphemeralTlsTest.kt b/cast/protocol/src/test/java/com/vayunmathur/cast/protocol/EphemeralTlsTest.ktindex d55f83860e..694ae0af6a 100644--- a/cast/protocol/src/test/java/com/vayunmathur/cast/protocol/EphemeralTlsTest.kt+++ b/cast/protocol/src/test/java/com/vayunmathur/cast/protocol/EphemeralTlsTest.kt@@ -46,10 +46,7 @@ class EphemeralTlsTest { // A TV that has been unplugged can come up hours behind. Anything in the stack that // checks dates would reject a certificate stamped in what it believes is the future. val certificate = EphemeralTls.server(listOf(loopback)).certificate- assertTrue(- certificate.notBefore.toInstant().isBefore(java.time.Instant.now().minusSeconds(3_600)),- "the certificate must already be valid by an hour at least",- )+ assertTrue(certificate.notBefore.toInstant().isBefore(java.time.Instant.now().minusSeconds(3_600)), "must be valid by an hour") } @Test
cast/src/screenshotTest/kotlin/com/vayunmathur/cast/ui/MetadataPreviews.kt
diff --git a/cast/src/screenshotTest/kotlin/com/vayunmathur/cast/ui/MetadataPreviews.kt b/cast/src/screenshotTest/kotlin/com/vayunmathur/cast/ui/MetadataPreviews.ktindex 3b3ed75b73..2108d3854b 100644--- a/cast/src/screenshotTest/kotlin/com/vayunmathur/cast/ui/MetadataPreviews.kt+++ b/cast/src/screenshotTest/kotlin/com/vayunmathur/cast/ui/MetadataPreviews.kt@@ -90,6 +90,18 @@ class MetadataPreviews { } } + @PreviewTest+ @Preview(name = "5-cast", device = PHONE, group = "phone", showSystemUi = true)+ @Composable+ fun Preview5Cast() {+ DynamicTheme(darkTheme = true) {+ CastContent(+ state = CastUiState(devices = Receivers, isScanning = false),+ actions = CastActions.Noop,+ )+ }+ }+ @PreviewTest @Preview(name = "4-mirroring", device = PHONE, group = "phone", showSystemUi = true) @Composable