Skip to content

libservo: Refactor site data integration test to enable reuse#41609

Merged
mrobinson merged 3 commits intoservo:mainfrom
janvarga:refactor-test-site-data
Jan 3, 2026
Merged

libservo: Refactor site data integration test to enable reuse#41609
mrobinson merged 3 commits intoservo:mainfrom
janvarga:refactor-test-site-data

Conversation

@janvarga
Copy link
Copy Markdown
Member

This PR refactors the test_site_data integration test to make its setup
infrastructure reusable.

The changes introduce a small WebViewTest helper and generalize the logic
for creating site data for test sites. This keeps the existing test behavior
but makes the setup suitable for upcoming tests for
SiteDataManager::clear_site_data.

Testing: Existing test_site_data integration test continues to pass.

@janvarga janvarga marked this pull request as ready for review December 31, 2025 17:29
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 31, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jan 1, 2026
@janvarga janvarga force-pushed the refactor-test-site-data branch from ef57d39 to 1fec84e Compare January 1, 2026 18:25
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 1, 2026
@janvarga janvarga force-pushed the refactor-test-site-data branch 2 times, most recently from c1f7a73 to 5e288fa Compare January 2, 2026 12:46
@mrobinson mrobinson added this pull request to the merge queue Jan 2, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 2, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 2, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 2, 2026
@janvarga
Copy link
Copy Markdown
Member Author

janvarga commented Jan 2, 2026

Ah, there's an issue, let me fix it.

@janvarga janvarga force-pushed the refactor-test-site-data branch from 5e288fa to 0d5d29c Compare January 2, 2026 21:39
@servo-highfive servo-highfive removed the S-tests-failed The changes caused existing tests to fail. label Jan 2, 2026
@janvarga
Copy link
Copy Markdown
Member Author

janvarga commented Jan 2, 2026

Introduce a small `WebViewTest` helper that encapsulates the boilerplate for
constructing a `Servo` instance, creating a `WebView`, and driving page loads
and script execution in integration tests.

This refactor reduces duplication in the existing `test_site_data` test and
makes the control flow easier to follow, without changing test behavior.

Signed-off-by: Jan Varga <[email protected]>
Refactor the site data integration test to introduce a reusable helper for
creating test sites with specific storage types (cookies, localStorage,
sessionStorage).

The new infrastructure allows tests to:
- construct multiple sites in a deterministic order
- attach optional per-site assertions that run immediately after creation
- reuse the same setup logic across different test scenarios

Signed-off-by: Jan Varga <[email protected]>
Fix a lifetime issue that appears with MSRV compiler by owning the callback in
`TestSiteDataStep` instead of borrowing it.

Signed-off-by: Jan Varga <[email protected]>
@janvarga janvarga force-pushed the refactor-test-site-data branch from 0d5d29c to da4d2ce Compare January 3, 2026 10:30
@mrobinson mrobinson added this pull request to the merge queue Jan 3, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 3, 2026
Merged via the queue into servo:main with commit 222c595 Jan 3, 2026
29 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants