Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / media / video-error-abort.html
blobabf1a37d588e8e829335c58d39f3ece812b9e873
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>'abort' event test</title>
5 <script src=../../media-resources/media-file.js></script>
6 <script src=../../media-resources/video-test.js></script>
7 <script>
8 var didLoad = false;
10 function loadstart()
12 consoleWrite("<br><b><em>'loadstart'</em> event</b>");
13 testExpected("video.error", null);
15 if (didLoad)
16 return;
17 didLoad = true;
19 // Force the element to reload, while the current movie is still loading,
20 // this should generate an 'abort' event
21 run("video.load()");
24 function abort()
26 consoleWrite("<br><b><em>'abort'</em> event</b>");
27 testExpected("video.error", null);
29 // Progress events have a 'lengthComputable' field, check to make sure this event
30 // doesn't have one.
31 testExpected("event.lengthComputable", undefined);
34 function canplaythrough()
36 consoleWrite("<br><b><em>'canplaythrough'</em> event</b>");
37 testExpected("video.error", null);
39 consoleWrite("");
40 endTest();
43 function start()
45 findMediaElement();
47 waitForEvent("error");
49 consoleWrite("<br><b>Test before movie is open</b>");
50 testExpected("video.error", null);
52 var movie = findMediaFile("video", "../resources/test");
53 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + movie + "&throttle=256";
55 </script>
56 </head>
58 <body onload="start()">
59 <video controls
60 onloadstart="loadstart()"
61 onabort="abort()"
62 oncanplaythrough="canplaythrough()"
63 ></video>
64 </body>
65 </html>