4 https://bugzilla.mozilla.org/show_bug.cgi?id=448534
8 <title>Test for Bug
448534</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <script type=
"text/javascript" src=
"manifest.js"></script>
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=448535">Mozilla Bug
448534</a>
16 <script class=
"testbody" type=
"text/javascript">
18 var manager = new MediaTestManager;
20 function loaded(event) {
22 info(v.token +
": event=" + event.type);
28 function started(event) {
30 info(v.token +
": event=" + event.type);
31 // For a short file, it could reach the end before 'play' received. We will
32 // skip the test for 'paused' would be true when ended.
33 if (v._finished || v.ended)
35 ok(!v.paused, v.token +
": Video should not be paused while playing");
40 function stopped(event) {
42 info(v.token +
": event=" + event.type);
46 ok(v.paused, v.token +
": Video should be paused after removing from the Document");
47 removeNodeAndSource(v);
48 manager.finished(v.token);
52 function startTest(test, token) {
53 var v = document.createElement('video');
54 v.preload =
"metadata";
56 manager.started(token);
60 v.addEventListener(
"loadedmetadata", loaded);
61 v.addEventListener(
"play", started);
62 v.addEventListener(
"pause", stopped);
63 document.body.appendChild(v);
66 manager.runTests(gSmallTests, startTest);