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