Repository navigation
test: address the sample's api/state from its document base, not its thread URL - #7023
Merged
Merged
Conversation
Since #6799, the sample frame's URL ends in `?thread=<id>`, so appending `api/state` to it requested the page document, and five journeys failed parsing that document as JSON. `_read_by_the_sample` now resolves `api/state` against the frame's `document.baseURI`, as `tests/browser/test_render_controls.py` already does. The behavior the tests protect is unchanged. Closes #7018
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.
Since #6799, the sample frame's URL carries the open thread (
?thread=<id>), so_read_by_the_sampleintests/journeys/test_render_read_state.pybuilt…/?thread=<id>api/statefromchild.url. That requested the page document, and five journeys failed parsing it as JSON (Unexpected UTF-8 BOM). The helper now resolvesapi/stateagainst the frame'sdocument.baseURI, astests/browser/test_render_controls.pyalready does, so a query on the page URL no longer changes the address. #6799 meant the address bar to name the thread. This change accepts that and leaves the tests' assertions as they were.Run locally with
-n0, all five failed onmain(e80dd78be) with the BOM error and all five pass with this change:test_render_read_state.py::test_a_sample_in_a_native_modal_escapes_inherited_inertnesstest_render_read_state.py::test_clipped_sample_cannot_acknowledge_child_viewporttest_render_read_state.py::test_offscreen_sample_cannot_acknowledge_child_viewporttest_render_sample_visibility.py::test_narrowing_a_partially_clipped_sample_does_not_acknowledge_hidden_wordstest_render_sample_visibility.py::test_sample_exposure_preserves_parent_declared_occlusionPull requests don't run
journeys/, so this PR's CI won't exercise them.Closes #7018 — automated triage