Commit d27b82ac authored by Mounir Lamouri's avatar Mounir Lamouri Committed by Commit Bot

Update controls-after-reload.html.

Initially written to reduce flakiness but kept the changes to make the
test matching modern web_tests expectations.

Bug: 1099997
Change-Id: Iae5c66e73b4255691f6e72e6126e8ade001bf937
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2304535Reviewed-by: default avatarTommy Steimel <steimel@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790007}
parent 832d6755
<html> <html>
<head> <head>
<script src=media-file.js></script> <script src="../resources/run-after-layout-and-paint.js"></script>
<script src=media-controls.js></script> <script src=media-controls.js></script>
<script>
var video;
if (window.testRunner)
testRunner.waitUntilDone();
function finish()
{
video.removeEventListener("seeked", finish);
if (window.testRunner)
testRunner.notifyDone();
}
function playing()
{
video.removeEventListener("playing", playing);
// Ensure that the frame is always the same in pixel result.
video.addEventListener("seeked", finish);
video.pause();
video.currentTime = 0;
}
function canplaythrough()
{
video.removeEventListener("canplaythrough", canplaythrough);
video.src = "content/test.ogv";
video.addEventListener("playing", playing);
video.play();
}
function test()
{
video = document.getElementsByTagName('video')[0];
enableTestMode(video);
video.addEventListener("canplaythrough", canplaythrough);
video.src = "content/counting.ogv";
}
</script>
</head> </head>
<body onload="test()"> <body>
<p>Making sure the controller looks ok after a second load().</p> <p>Making sure the controller looks ok after a second load().</p>
<video controls></video> <video controls></video>
</body> </body>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
const video = document.getElementsByTagName('video')[0];
enableTestMode(video);
video.addEventListener("canplaythrough", () => {
video.src = "content/test.ogv";
video.play().then(() => {
// Ensure that the frame is always the same in pixel result.
video.addEventListener("seeked", () => {
runAfterLayoutAndPaint(() => {
if (window.testRunner)
testRunner.notifyDone();
});
}, { once: true });
video.pause();
video.currentTime = 0;
});
}, { once: true });
video.src = "content/counting.ogv";
</script>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment