summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html')
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html
new file mode 100644
index 0000000000..9b2783c930
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>HTML5 Media Elements: The size of the video shouldn't be lost after an 'ended' event.</title>
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+ <link rel="author" title="Alicia Boya GarcĂ­a" href="mailto:aboya@igalia.com"/>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+</head>
+<body>
+<video id="video">
+ <source src="/media/test-1s.mp4" type="video/mp4">
+ <source src="/media/test-1s.webm" type="video/webm">
+</video>
+<script>
+ promise_test(async (test) => {
+ const eventWatcher = new EventWatcher(test, video, ["loadedmetadata", "ended"]);
+ await eventWatcher.wait_for("loadedmetadata");
+ assert_equals(video.videoWidth, 320, "width when the video is loaded");
+ assert_equals(video.videoHeight, 240, "height when the video is loaded");
+ video.play();
+ await eventWatcher.wait_for(["ended"]);
+ assert_equals(video.videoWidth, 320, "width after playback");
+ assert_equals(video.videoHeight, 240, "height after playback");
+ if (video.videoTracks)
+ assert_equals(video.videoTracks.length, 1);
+ }, "Video dimensions are preserved at the end of the video.");
+</script>
+</body>
+</html>