4 <script src=media-file.js></script>
5 <script src=video-test.js></script>
11 video = document.getElementsByTagName("video")[0];
12 video.src = findMediaFile("video", "content/test");
14 waitForEvent("canplaythrough", start);
15 waitForEvent("seeked", seeked);
16 waitForEvent("error", error);
19 function getTimeLineValue()
21 var timelineContainer;
24 var controlsShadow = internals.shadowRoot(video).firstChild.firstChild;
25 for (child = controlsShadow.firstChild; child; child = child.nextSibling)
26 if (internals.shadowPseudoId(child) == "-webkit-media-controls-timeline-container") {
27 timelineContainer = child;
31 if(!timelineContainer)
32 throw "Faild to find -webkit-media-controls-timeline-container";
34 for (child = timelineContainer.firstChild; child; child = child.nextSibling)
35 if (internals.shadowPseudoId(child) == "-webkit-media-controls-timeline") {
36 timelineValue = child.value;
40 if(!timelineContainer)
41 throw "Faild to find -webkit-media-controls-timeline";
49 testExpected("getTimeLineValue()", video.currentTime);
52 failTest(exception.description);
59 testExpected("getTimeLineValue()", video.currentTime);
61 failTest(exception.description);
64 // Change video source to an invalid one
65 video.src = "/invalid.mov";
70 if (!window.layoutTestController)
74 testExpected("getTimeLineValue()", video.currentTime);
76 failTest(exception.description);
79 // Seeking to time value 1.0
80 video.currentTime = 1.0;
84 <body onload="init()">
85 <p>This tests that media element controls are reset to their default state when the src is changed to an invalid url.</p>
86 <p>This test only runs in DRT!</p>
87 <video controls></video>
88 <div id="console"></div>