зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1113596 - add logs to track media element events. r=edwin
This commit is contained in:
Родитель
39f5853100
Коммит
5974cd1b2b
|
@ -11,6 +11,7 @@
|
|||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.requestCompleteLog();
|
||||
var manager = new MediaTestManager;
|
||||
|
||||
function cloneLoaded(event) {
|
||||
|
@ -32,6 +33,19 @@ function tryClone(event) {
|
|||
var clone = e.cloneNode(false);
|
||||
clone.token = e.token;
|
||||
|
||||
// Log events for debugging.
|
||||
var events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata",
|
||||
"loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort",
|
||||
"waiting", "pause"];
|
||||
function logEvent(evt) {
|
||||
var e = evt.target;
|
||||
info(e.token + ": got " + evt.type);
|
||||
}
|
||||
events.forEach(function(e) {
|
||||
clone.addEventListener(e, logEvent, false);
|
||||
});
|
||||
|
||||
|
||||
if (e._expectedDuration) {
|
||||
ok(Math.abs(e.duration - e._expectedDuration) < 0.1,
|
||||
e.currentSrc + " duration: " + e.duration + " expected: " + e._expectedDuration);
|
||||
|
|
Загрузка…
Ссылка в новой задаче