Skip to content

test(sri): split cases into tables per origin + scheme - #676

Draft
caugner wants to merge 4 commits into
464-sri-bonus-requires-all-scriptsfrom
464-split-sri-tests
Draft

caugner wants to merge 4 commits into
464-sri-bonus-requires-all-scriptsfrom
464-split-sri-tests

Conversation

@caugner

@caugner caugner commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Description

Restructure the Subresource Integrity tests into table-driven cases, grouped by script origin and scheme:

  • Split multi-scenario tests into one test per case.
  • Test protocol-relative scripts as a matrix of fixtures (with SRI, without SRI, different subdomain) and HTTP scenarios (redirects to HTTPS, no HTTP server, HTTP hop before HTTPS, stays on HTTP).
  • Rename the test_content_sri_impl_external_https1/2.html fixtures to _remote and _localhost.

Motivation

Make each scenario fail independently with a descriptive name, and make gaps in the case matrix visible. The "with SRI" protocol-relative cases previously lacked the "no HTTP server" and "HTTP hop" scenarios.

Additional details

Related issues and pull requests

Depends on:

@caugner
caugner added this pull request to stack #642 November 24, 2026 16:42
Run each scenario as its own test, so a failure names the case and does
not hide the remaining ones. Cover every HTTP redirect scenario for
protocol-relative scripts both with and without `integrity`.

Rename `test_content_sri_impl_external_https1/2.html` fixtures to
`_remote` and `_localhost`.
Annotate `httpScenarios` once instead of typing each `setup`, and omit the no-op `setup` of the default scenario.
Document that table entries hold an `Expectation` value rather than an arbitrary string.
The cross-origin script determines the result, so the case belongs with the other explicit-scheme cross-origin cases.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant