OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Tests that a media file is served as "text/plain".</title> |
3 <head> | 3 <script src="../resources/testharness.js"></script> |
4 <title>media file served as 'text/plain'</title> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script src=../../media-resources/media-file.js></script> | 5 <script src="../../media-resources/media-file.js"></script> |
6 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 6 <video></video> |
7 (Please avoid writing new tests using video-test.js) --> | 7 <script> |
8 <script src=../../media-resources/video-test.js></script> | 8 async_test(function(t) { |
9 <script> | 9 var video = document.querySelector("video"); |
10 function loadedmetadata(evt) | |
11 { | |
12 logResult(true, "loaded media file served as text"); | |
13 endTest(); | |
14 } | |
15 | 10 |
16 function error(evt) | 11 var watcher = new EventWatcher(t, video, ["loadstart", "loadedmetadata", "er
ror"]); |
17 { | 12 watcher.wait_for(["loadstart", "loadedmetadata"]).then(t.step_func_done()); |
18 logResult(false, "failed trying to load media file served as tex
t"); | 13 assert_equals(video.error, null); |
19 endTest(); | |
20 } | |
21 | 14 |
22 function start() | 15 var movie = findMediaFile("video", "resources/test"); |
23 { | 16 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + m
ovie + "&throttle=99999&type=text/plain"; |
24 findMediaElement(); | 17 }); |
25 | 18 </script> |
26 waitForEvent('loadedmetadata', loadedmetadata); | |
27 waitForEvent("error", error); | |
28 waitForEvent("loadstart"); | |
29 testExpected("video.error", null); | |
30 | |
31 var movie = findMediaFile("video", "resources/test"); | |
32 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cg
i?name=" + movie + "&throttle=99999&type=text/plain"; | |
33 } | |
34 </script> | |
35 </head> | |
36 | |
37 <body onload="start()"> | |
38 <video controls></video> | |
39 </body> | |
40 </html> | |
OLD | NEW |