OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src=media-file.js></script> | 4 <script src=media-file.js></script> |
5 <script src=video-test.js></script> | 5 <script src=video-test.js></script> |
6 <script src=media-controls.js></script> | 6 <script src=media-controls.js></script> |
7 <script> | 7 <script> |
8 var video; | 8 var video; |
9 | 9 |
10 function init() | 10 function init() |
11 { | 11 { |
12 video = document.getElementsByTagName("video")[0]; | 12 video = document.getElementsByTagName("video")[0]; |
13 video.src = findMediaFile("video", "content/test"); | 13 video.src = findMediaFile("video", "content/test"); |
14 | 14 |
15 waitForEventOnce("canplaythrough", start); | 15 waitForEventOnce("canplaythrough", start); |
16 waitForEvent("seeked", seeked); | 16 waitForEvent("seeked", seeked); |
17 waitForEvent("error", error); | 17 waitForEvent("error", error); |
18 } | 18 } |
19 | 19 |
20 function getTimeLineValue() | 20 function getTimeLineValue() |
21 { | 21 { |
22 var timeline; | 22 return mediaControlsButton(video, "timeline").value; |
23 var shadowRoot = internals.shadowRoot(video); | |
24 | |
25 timeline = mediaControlsElement(shadowRoot.firstChild.firstChild
, '-webkit-media-controls-timeline'); | |
26 | |
27 if(!timeline) | |
28 throw "Faild to find -webkit-media-controls-timeline"; | |
29 | |
30 return timeline.value; | |
31 } | 23 } |
32 | 24 |
33 function error() | 25 function error() |
34 { | 26 { |
35 try { | 27 try { |
36 testExpected("getTimeLineValue()", video.currentTime); | 28 testExpected("getTimeLineValue()", video.currentTime); |
37 endTest(); | 29 endTest(); |
38 } catch (exception) { | 30 } catch (exception) { |
39 failTest(exception.description); | 31 failTest(exception.description); |
40 } | 32 } |
(...skipping 27 matching lines...) Expand all Loading... |
68 } | 60 } |
69 </script> | 61 </script> |
70 </head> | 62 </head> |
71 <body onload="init()"> | 63 <body onload="init()"> |
72 <p>This tests that media element controls are reset to their default sta
te when the src is changed to an invalid url.</p> | 64 <p>This tests that media element controls are reset to their default sta
te when the src is changed to an invalid url.</p> |
73 <p>This test only runs in DRT!</p> | 65 <p>This test only runs in DRT!</p> |
74 <video controls></video> | 66 <video controls></video> |
75 <div id="console"></div> | 67 <div id="console"></div> |
76 </body> | 68 </body> |
77 </html> | 69 </html> |
OLD | NEW |