Commit 5baeede1 authored by Thomas Guilbert's avatar Thomas Guilbert Committed by Chromium LUCI CQ

Deflake video-currentTime.html

This CL reduces variablity in the video-currentTime.html test by waiting
until we decode the first frame before playing the video, and then
waiting for the play() promise to resolve before starting at timer to
check the currentTime.

Bug: 1006852
Change-Id: I3c0d9817f3f77f2a0bf085917f578bc11fd19b3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567570
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832474}
parent aa8e8e4c
......@@ -8,15 +8,18 @@ async_test(function(t) {
var video = document.querySelector("video");
assert_equals(video.currentTime, 0);
video.oncanplaythrough = t.step_func(function() {
assert_equals(video.currentTime, 0);
video.play();
video.requestVideoFrameCallback(t.step_func(() => {
assert_equals(video.currentTime, 0)
var endTest =
t.step_func_done(() => assert_greater_than(video.currentTime, 0));
setTimeout(t.step_func_done(function() {
assert_greater_than(video.currentTime, 0);
}), 500);
videos.ontimeupdate = endTest;
videos.onended = endTest;
video.play();
});
video.src = "content/test.ogv";
});
</script>
\ No newline at end of file
</script>
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