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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/ready-states/autoplay-with-slow-text-tracks.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <title>autoplay with slow text tracks</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="/common/media.js"></script>
6 <div id="log"></div>
7 <script>
8 // https://html.spec.whatwg.org/#ready-states says:
9 //
10 // HAVE_FUTURE_DATA: "the text tracks are ready".
11 // HAVE_ENOUGH_DATA: All the conditions described for the HAVE_FUTURE_DATA state are met, ...
12 //
13 // When the ready state of a media element whose networkState is not NETWORK_EMP TY changes,
14 // the user agent must follow the steps given below:
15 // If the new ready state is HAVE_ENOUGH_DATA
16 // (autoplay)
17 //
18 // So if the text tracks are not yet ready, we can't autoplay.
19
20 var started = 0;
21 var numOfTests = 5;
22
23 function createTest() {
24 var video = document.createElement('video');
25 video.src = getVideoURI('/media/movie_5');
26 video.autoplay = true;
27 video.muted = true;
28 video.controls = true;
29 video.onplaying = function() {
30 started++;
31 assert_equals(track.track.cues.length, 1);
32 if (started === numOfTests) {
33 done();
34 }
35 };
36 var track = document.createElement('track');
37 track.src = '/media/foo.vtt?pipe=trickle(d2)';
38 track.default = true;
39 video.appendChild(track);
40 document.body.appendChild(video);
41 }
42 for (var i = 0; i < numOfTests; ++i) {
43 createTest();
44 }
45 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698