Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: LayoutTests/media/video-durationchange-on-ended.html

Issue 790153002: Add test to verify durationchange event if the actual duration is wrong (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplified test case, asserted duration change Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/video-durationchange-on-ended.html
diff --git a/LayoutTests/media/video-durationchange-on-ended.html b/LayoutTests/media/video-durationchange-on-ended.html
new file mode 100644
index 0000000000000000000000000000000000000000..f9a0d86a4561106b77c61221cf426adee50e5f61
--- /dev/null
+++ b/LayoutTests/media/video-durationchange-on-ended.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src=video-test.js></script>
+ </head>
+ <body>
+ <p>Verify there is a 'durationchange' event just before 'ended' event if the initially reported duration exceeds the actual data.</p>
+ <script>
+ var initialReportedDuration = -1;
+
+ video = document.createElement('video');
+ document.body.appendChild(video);
+ video.src = "content/truncated.webm";
+ video.play();
+ waitForEvent('durationchange', function() {
+ // Note the initial reported duration
+ if (initialReportedDuration == -1)
+ initialReportedDuration = video.duration;
+ });
+
+ waitForEventAndEnd('ended', function() {
+ // Verify that the actual duration is less than
+ // the initial reported duration
+ testExpected("video.duration < initialReportedDuration", true);
+ });
+ </script>
+ </body>
+</html>
« no previous file with comments | « LayoutTests/media/content/truncated.webm ('k') | LayoutTests/media/video-durationchange-on-ended-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698