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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-load-preload-none.html

Issue 2077413002: Convert video-duration*, video-error* and video-load* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 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
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <title>Test that an explicit load() to a media element whose preload is set to " none" still loads the video.</title>
3 <script src="media-file.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 4 <script src="../resources/testharnessreport.js"></script>
5 (Please avoid writing new tests using video-test.js) --> 5 <script src="media-file.js"></script>
6 <script src="video-test.js"></script> 6 <video preload="none"></video>
7 <script> 7 <script>
8 function start() 8 async_test(function(t) {
9 { 9 var video = document.querySelector("video");
10 findMediaElement();
11 video.src = findMediaFile("video", "content/test");
12 10
13 testExpected("video.preload", "none"); 11 assert_equals(video.preload, "none");
14 testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING); 12 assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
15 waitForEventAndEnd('loadedmetadata'); 13 video.onloadedmetadata = t.unreached_func();
16 14
17 // Wait 250ms before load()ing to make sure setting src does not kick off the load 15 // Wait 500ms before load()ing to make sure setting src does not
18 // (i.e. preload=none should still be respected). 16 // kick off the load (i.e. preload=none should still be respected).
19 setTimeout(load, 250); 17 setTimeout(function() {
20 } 18 assert_equals(video.readyState, HTMLMediaElement.HAVE_NOTHING);
21 function load() 19 video.onloadedmetadata = t.step_func_done();
22 { 20 video.load();
23 testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING); 21 }, 300);
24 run("video.load()");
25 }
26 </script>
27 </head>
28 22
29 <body> 23 video.src = findMediaFile("video", "content/test");
30 <video preload="none"></video> 24 });
31 <p>Test that an explicit load() to a media element whose preload is set to "none" still loads the video.</p> 25 </script>
32 <script>start();</script>
33 </body>
34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698