4 <script src=media-file.js
></script>
5 <script src=video-test.js
></script>
6 <script src=media-controls.js
></script>
8 if (window
.testRunner
) {
9 testRunner
.dumpAsText();
10 testRunner
.waitUntilDone();
15 var console
= document
.getElementById('console');
16 console
.innerHTML
= console
.innerHTML
+ msg
+ "<br>";
21 if (window
.GCController
)
22 return GCController
.collect();
24 // Force garbage collection
25 for (var ndx
= 0; ndx
< 99000; ndx
++)
26 var str
= new String("1234");
29 function buttonClick()
33 if (document
.getElementById('audio'))
34 log("<br>FAIL: audio element not deleted!!");
36 log("<br>clicking button");
39 var button
= document
.getElementById('button');
40 eventSender
.mouseMoveTo(button
.offsetLeft
+ 20, button
.offsetTop
+ 7);
41 eventSender
.mouseDown();
42 eventSender
.mouseUp();
44 testRunner
.notifyDone();
47 function deleteAudio()
49 var audio
= document
.getElementById('audio');
53 log("<br>deleting audio element");
54 audio
.parentNode
.removeChild(audio
);
56 setTimeout(buttonClick
, 10);
61 if (!window
.testRunner
)
64 testRunner
.dumpAsText();
65 testRunner
.waitUntilDone();
67 var audio
= document
.getElementById('audio');
70 seekCoords
= mediaControlsButtonCoordinates(audio
, "timeline");
72 failTest(exception
.description
);
75 var x
= seekCoords
[0];
76 var y
= seekCoords
[1];
78 // Click in the slider to get the thumb under the mouse.
79 log("clicking in controller");
80 eventSender
.mouseMoveTo(x
, y
);
81 eventSender
.mouseDown();
82 eventSender
.mouseUp();
84 // Click slider to scrub, leave the mouse down.
85 log("clicking on thumb");
86 eventSender
.mouseDown();
87 eventSender
.mouseMoveTo(x
, y
+ 20);
89 // Remove the element after seeking started
90 audio
.addEventListener("seeking", deleteAudio
);
96 setSrcByTagName("audio", findMediaFile("audio", "content/test"));
101 <body onload=
"start()">
102 This tests that events don't continue to target a slider thumb if the media element is deleted while scrubbing.
104 <input type=
"button" id=
"button" value=
"Click Me!" onmouseup=
"log('button click!')">
106 <audio id=
"audio" autoplay
onplaying=
"drag()" controls
></audio><br><br>
107 <div id=
"console"></div>