Commit fdde4b45 authored by Thomas Guilbert's avatar Thomas Guilbert Committed by Commit Bot

Migrate video-raf tests to WPT

This CL moves the video.requestAnimationFrame tests to a new directory
in the web platform tests, and makes small updates to resources used.

Bug: 1044796
Change-Id: I0f07391695ef36b0631bd3e4986a69086bf16a6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2024036Reviewed-by: default avatarChrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735979}
parent 08e5b730
spec: https://wicg.github.io/video-rag/
suggested_reviewers:
- tguilbert
\ No newline at end of file
# HTMLVideoElement.requestAnimationFrame specification Tests
The HTMLVideoElement.requestAnimationFrame specification is available here: https://wicg.github.io/video-raf
GitHub repository: https://github.com/WICG/video-raf
File an issue: https://github.com/wicg/video-raf/issues/new
## Status of these tests
Theses tests are still basic. The specification is still WIP, and rendering tests will be added to ensure consistenty of behavior/timing relative to other [AnimationFrameProviders](https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animation-frames) (e.g. window.rAF).
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<title>Test having multiple video.rAF callbacks pending for a single frame.</title> <html>
<script src="../resources/testharness.js"></script> <title>Test having multiple video.rAF callbacks in flight for a single element.</title>
<script src="../resources/testharnessreport.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<script> <script>
async_test(function(t) { async_test(function(t) {
...@@ -20,7 +22,7 @@ async_test(function(t) { ...@@ -20,7 +22,7 @@ async_test(function(t) {
assert_object_equals(firstMetadata, metadata); assert_object_equals(firstMetadata, metadata);
})); }));
video.src = "content/test.webm"; video.src = getVideoURI('/media/movie_5');
video.play(); video.play();
}, 'Test callbacks get the same information.'); }, 'Test callbacks get the same information.');
...@@ -45,7 +47,8 @@ async_test(function(t) { ...@@ -45,7 +47,8 @@ async_test(function(t) {
t.step_func_done() t.step_func_done()
); );
video.src = "content/test.webm"; video.src = getVideoURI('/media/movie_5');
video.play(); video.play();
}, 'Test we can cancel callbacks from callbacks.'); }, 'Test we can cancel callbacks from callbacks.');
</script> </script>
\ No newline at end of file </html>
<!DOCTYPE html> <!DOCTYPE html>
<title>Test calling video.requestAnimationFrame() from a video.rAF callback.</title> <html>
<script src="../resources/testharness.js"></script> <title>Test repeatedly chaining video.rAF() callbacks.</title>
<script src="../resources/testharnessreport.js"></script> <script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<script> <script>
async_test(function(t) { async_test(function(t) {
...@@ -26,10 +28,10 @@ async_test(function(t) { ...@@ -26,10 +28,10 @@ async_test(function(t) {
})); }));
video.src = "content/test.webm"; video.src = getVideoURI('/media/movie_5');
video.play(); video.play();
}, 'Test callbacks are only called on the next frame.'); }, 'Test new callbacks are only called on the next frame.');
async_test(function(t) { async_test(function(t) {
let video = document.createElement('video'); let video = document.createElement('video');
...@@ -51,8 +53,9 @@ async_test(function(t) { ...@@ -51,8 +53,9 @@ async_test(function(t) {
video.requestAnimationFrame(t.step_func(frameNumberVerifier)); video.requestAnimationFrame(t.step_func(frameNumberVerifier));
video.src = "content/test.webm"; video.src = getVideoURI('/media/movie_5');
video.play(); video.play();
}, 'Test chaining calls to video.rAF.'); }, 'Test chaining calls to video.rAF.');
</script> </script>
\ No newline at end of file </html>
<!DOCTYPE html> <!DOCTYPE html>
<html>
<title>Test the basics of the video.requestAnimationFrame() API.</title> <title>Test the basics of the video.requestAnimationFrame() API.</title>
<script src="../resources/testharness.js"></script> <script src="/resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<script> <script>
var testVideo = { var testVideo = {
url: "content/test.webm", url: getVideoURI('/media/movie_5'),
height: 180, height: 240,
width: 320, width: 320,
} }
...@@ -72,4 +73,5 @@ test(function(t) { ...@@ -72,4 +73,5 @@ test(function(t) {
video.cancelAnimationFrame(-1); video.cancelAnimationFrame(-1);
}, 'Test invalid calls to the video.rAF API.'); }, 'Test invalid calls to the video.rAF API.');
</script> </script>
\ No newline at end of file </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