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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-delay-load-event.html

Issue 1810513002: Media element resource selection algorithm should "await a stable state" Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, microtask changes, layouttest updation Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-source.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Test that the document's load event is delayed until a video's meta data is available.</title> 2 <title>Test that the document's load event is delayed until a video's meta data is available.</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="media-file.js"></script> 5 <script src="media-file.js"></script>
6 <video id="video1"></video> 6 <video id="video1"></video>
7 <video id="video2"></video> 7 <video id="video2"></video>
8 <video id="video3"><source></source></video> 8 <video id="video3"></video>
9 <script> 9 <script>
10 async_test(function(t) { 10 async_test(function(t) {
11 assertVideoNoSrcNoLoad(document.getElementById("video1")); 11 assertVideoNoSrcNoLoad(document.getElementById("video1"));
12 12
13 var video = document.getElementById("video2"); 13 var video = document.getElementById("video2");
14 video.src = findMediaFile("video", "content/test"); 14 video.src = findMediaFile("video", "content/test");
15 assertVideoSrcNoLoad(video); 15 assertVideoSrcNoLoad(video);
16 16
17 var source = document.querySelector("source"); 17 var source = document.createElement("source");
18 source.src = findMediaFile("video", "content/test"); 18 source.src = findMediaFile("video", "content/test");
19 assertVideoSrcNoLoad(document.getElementById("video3")); 19 var video3 = document.getElementById("video3");
20 video3.appendChild(source);
21 assertVideoSrcNoLoad(video3);
20 22
21 window.onload = t.step_func_done(function() { 23 window.onload = t.step_func_done(function() {
22 assertVideoNoSrcNoLoad(document.getElementById("video1")); 24 assertVideoNoSrcNoLoad(document.getElementById("video1"));
23 assertVideoSrcLoad(document.getElementById("video2")); 25 assertVideoSrcLoad(document.getElementById("video2"));
24 assertVideoSrcLoad(document.getElementById("video3")); 26 assertVideoSrcLoad(document.getElementById("video3"));
25 }); 27 });
26 28
27 function assertVideoNoSrcNoLoad(video) { 29 function assertVideoNoSrcNoLoad(video) {
28 // Video should not load as there is no "src". 30 // Video should not load as there is no "src".
29 assert_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY); 31 assert_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
30 assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING); 32 assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
31 } 33 }
32 34
33 function assertVideoSrcNoLoad(video) { 35 function assertVideoSrcNoLoad(video) {
34 // Video loading has just triggered. 36 // Video loading has just triggered.
35 assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); 37 assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
36 assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING); 38 assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
37 } 39 }
38 40
39 function assertVideoSrcLoad(video) { 41 function assertVideoSrcLoad(video) {
40 // The Video should have loaded at least to HAVE_CURRENT_DATA 42 // The Video should have loaded at least to HAVE_CURRENT_DATA
41 assert_not_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE ); 43 assert_not_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE );
42 assert_greater_than_equal(video.networkState, HTMLMediaElement.NETWORK_I DLE); 44 assert_greater_than_equal(video.networkState, HTMLMediaElement.NETWORK_I DLE);
43 assert_greater_than_equal(video.readyState, HTMLMediaElement.HAVE_CURREN T_DATA); 45 assert_greater_than_equal(video.readyState, HTMLMediaElement.HAVE_CURREN T_DATA);
44 } 46 }
45 }); 47 });
46 </script> 48 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/video-source.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698