Automatic update from web-platform-tests Change HTML Video and Audio Lazy Loading Tests from Tentative to Non-Tentative -- wpt-commits: a024f97737b84b2531e9b37e9db5f3e80a7ac110 wpt-pr: 57754
34 lines
863 B
HTML
34 lines
863 B
HTML
<!DOCTYPE html>
|
|
<link rel="author" title="Squarespace" href="https://www.squarespace.com/">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
|
|
<style>
|
|
.below-viewport {
|
|
margin-top: 1000vh;
|
|
}
|
|
</style>
|
|
<body>
|
|
|
|
<script>
|
|
async_test(t => {
|
|
const audio = document.createElement("audio");
|
|
audio.id = "below_viewport";
|
|
audio.className = "below-viewport";
|
|
audio.src = "/media/sine440.mp3?pipe=trickle(d2)";
|
|
audio.loading = "eager";
|
|
audio.controls = true;
|
|
|
|
audio.addEventListener("loadeddata", () => {
|
|
t.done();
|
|
});
|
|
|
|
document.body.appendChild(audio);
|
|
|
|
t.step_timeout(() => {
|
|
assert_unreached("Eager audio should load data immediately");
|
|
}, 5000);
|
|
}, "Audio with loading='eager' loads immediately regardless of viewport position");
|
|
</script>
|
|
</body>
|