commit 5ff7e1b12e9ceb7e2cd139cdf6ab8d311c9c7862
parent 81404b8a991c1a910e5fad1921fe3a9d6fd70973
Author: Andrei Volykhin <andrei.volykhin@gmail.com>
Date: Wed, 15 Oct 2025 08:23:31 +0000
Bug 1993599 [wpt PR 55324] - html: Provide a stable state for the media resource selection, a=testonly
Automatic update from web-platform-tests
html: Provide a stable state for the media resource selection
The media resource selection algorithm is not able to execute
the sync section steps because the script doesn't provide
any posibility for it, so let's move the latest checking
of the networkState to separate script.
See https://html.spec.whatwg.org/multipage/#concept-media-load-algorithm
Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
--
wpt-commits: 5ebc87ad02be7afbff417b1445c17e8f1ce95c66
wpt-pr: 55324
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-in-sync-event.html b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/loading-the-media-resource/resource-selection-invoke-in-sync-event.html
@@ -19,11 +19,11 @@ var t = async_test(function(t) {
assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after click()');
v.removeAttribute('src');
});
+</script>
+<!-- now resource selection will continue its sync section (the </script> tag below provides a stable state) -->
+<!-- will find neither src nor source, so sets networkState to NETWORK_EMPTY -->
+<script>
t.step(function() {
- // now the sync section of resource selection should have run and should
- // have found no src="" or <source> thus networkState being set to NETWORK_EMPTY.
- // if the sync section was run when onclick returned, then networkState
- // would be either NETWORK_LOADING or NETWORK_NO_SOURCE.
assert_equals(v.networkState, v.NETWORK_EMPTY, 'networkState after src removed');
t.done();
});