libservo: Refactor site data integration test to enable reuse#41609
Merged
mrobinson merged 3 commits intoservo:mainfrom Jan 3, 2026
Merged
libservo: Refactor site data integration test to enable reuse#41609mrobinson merged 3 commits intoservo:mainfrom
mrobinson merged 3 commits intoservo:mainfrom
Conversation
mrobinson
approved these changes
Jan 1, 2026
ef57d39 to
1fec84e
Compare
c1f7a73 to
5e288fa
Compare
Member
Author
|
Ah, there's an issue, let me fix it. |
5e288fa to
0d5d29c
Compare
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]>
0d5d29c to
da4d2ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the
test_site_dataintegration test to make its setupinfrastructure reusable.
The changes introduce a small
WebViewTesthelper and generalize the logicfor 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_dataintegration test continues to pass.