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

Unified Diff: LayoutTests/http/tests/media/video-buffered-unknown-duration.html

Issue 499513002: Add layout test and test media for infinite duration tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months 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/http/tests/media/video-buffered-unknown-duration.html
diff --git a/LayoutTests/http/tests/media/video-buffered-unknown-duration.html b/LayoutTests/http/tests/media/video-buffered-unknown-duration.html
new file mode 100644
index 0000000000000000000000000000000000000000..0f831f58dced41efa765c5316115e3724fa24b15
--- /dev/null
+++ b/LayoutTests/http/tests/media/video-buffered-unknown-duration.html
@@ -0,0 +1,38 @@
+<html>
scherkus (not reviewing) 2014/08/22 01:07:34 add <!DOCTYPE html> -- the official doctype of htm
DaleCurtis 2014/08/22 01:55:07 Done.
+<head>
scherkus (not reviewing) 2014/08/22 01:07:33 nit: drop empty head
DaleCurtis 2014/08/22 01:55:08 Done.
+</head>
+<body onload="start()">
+<p>Load a video via preloading; verify infinite duration. Start playback and
scherkus (not reviewing) 2014/08/22 01:07:33 Prehaps rewords this to say "loading a file with u
DaleCurtis 2014/08/22 01:55:08 Done.
+ ensure currentTime &lt; end of the buffered range upon first timeupdate.</p>
+<video id="video" preload="auto"></video>
scherkus (not reviewing) 2014/08/22 01:07:34 nit: no need for an id
scherkus (not reviewing) 2014/08/22 01:07:34 nit: default preload attribute is auto
DaleCurtis 2014/08/22 01:55:07 Done.
DaleCurtis 2014/08/22 01:55:08 Done.
+<script src=../../media-resources/video-test.js></script>
scherkus (not reviewing) 2014/08/22 01:07:33 nit: "" all attribute strings
DaleCurtis 2014/08/22 01:55:08 Done.
+<script src=../../media-resources/media-file.js></script>
+<script>
+ waitForEventOnce('timeupdate', function() {
+ video.pause();
+
+ testExpected("video.duration", Infinity, "==");
scherkus (not reviewing) 2014/08/22 01:07:34 nit: javascript uses ' over " for all strings
DaleCurtis 2014/08/22 01:55:07 Done.
+ testExpected("video.buffered.start(0)", 0, ">=");
+
+ // 1000 arbitrarily chosen, just some value > duration for testing for
scherkus (not reviewing) 2014/08/22 01:07:34 would duration + 1 suffice? or just compare > dur
DaleCurtis 2014/08/22 01:55:07 I want it to be immune to any future minor changes
+ // overflow of an infinite duration.
+ testExpected("video.buffered.end(0)", 1000, "<");
+ test("video.currentTime <= video.buffered.end(0)", true);
scherkus (not reviewing) 2014/08/22 01:07:34 boy oh boy does video-test.js contain some real ge
DaleCurtis 2014/08/22 01:55:07 Don't want to use testExpected() since it will pri
+ });
+
+ waitForEventOnce('loadeddata', function() {
+ testExpected("video.buffered.length", 1, "==");
+ testExpected("video.buffered.start(0)", 0, ">=");
+ testExpected("video.buffered.end(0)", Infinity, "!=");
+ testExpected("video.currentTime", 0, "==");
+ testExpected("video.duration", Infinity, "==");
+ video.play();
+ });
+
+ function start () {
scherkus (not reviewing) 2014/08/22 01:07:33 nit: remove space before ()
DaleCurtis 2014/08/22 01:55:08 Done.
+ video = document.getElementById('video');
scherkus (not reviewing) 2014/08/22 01:07:34 funny enough by loading the video-test.js script i
DaleCurtis 2014/08/22 01:55:08 Done.
+ video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?nph=1&name=resources/test-live.webm&throttle=100&type=video/webm";
scherkus (not reviewing) 2014/08/22 01:07:33 do you need to run this through the cgi? would po
DaleCurtis 2014/08/22 01:55:08 Looks like it works either way, moved.
+ }
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698