mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
Tests: Add a test for media element ready state progression
This commit is contained in:
committed by
Gregory Bertilson
parent
cf3d9c1bae
commit
041213a597
Notes:
github-actions[bot]
2026-03-22 04:14:19 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/041213a5971 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8545
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<video id="video"></video>
|
||||
<script>
|
||||
const video = document.getElementById("video");
|
||||
|
||||
function logEvent(name) {
|
||||
let entry = `${name}: readyState=${video.readyState}`;
|
||||
if (name === "durationchange")
|
||||
entry += ` duration=${video.duration}`;
|
||||
println(entry);
|
||||
}
|
||||
|
||||
for (const name of [
|
||||
"loadstart", "durationchange", "loadedmetadata",
|
||||
"loadeddata", "canplay", "canplaythrough",
|
||||
]) {
|
||||
video.addEventListener(name, () => logEvent(name));
|
||||
}
|
||||
|
||||
asyncTest(done => {
|
||||
video.addEventListener("canplaythrough", () => done());
|
||||
video.src = "../../../Assets/test-webm.webm";
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user