test(browser): drive a canvas-under-shadow-root fixture end to end

This commit is contained in:
pj committed 2026-08-13 00:42:02 +05:30
1 parent 61be8c0788
commit 596f0e0766
3 files changed
+72

No files matched your search

+12
View File
@@ -53,6 +53,18 @@ func TestBrowserCounterInvariantHolds(t *testing.T) {
}
}
// TestBrowserShadowDOMIsReachable drives a page whose entire UI (canvas, the
// button over it, and the counter) lives inside a shadow root, the shape
// Compose for Web produces. Both the enumeration and the selector lookup have
// to cross the boundary for the counter to move at all, so the property firing
// is the end-to-end evidence.
func TestBrowserShadowDOMIsReachable(t *testing.T) {
violations := runFixture(t, "shadow")
if !slices.Contains(violations, "counterNeverMoves") {
t.Fatalf("nothing inside the shadow root was ever tapped; violations=%v", violations)
}
}
// runFixture serves the named testdata case over an in-process file server,
// drives it through headless Chrome with a fixed seed and a bounded step count,
// and returns every property name that was ever reported violated.