4 <title>Test looping support
</title>
5 <script type=
"text/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
7 <script type=
"text/javascript" src=
"manifest.js"></script>
11 <script class=
"testbody" type=
"text/javascript">
12 var manager = new MediaTestManager;
14 function startTest(test, token) {
15 manager.started(token);
16 var v = document.createElement('video');
25 v.addEventListener(
"play", function (e) {
26 e.target.playCount +=
1;
27 ok(e.target.playCount ==
1,
"Should get exactly one play event.");
30 v.addEventListener(
"seeking", function (e) {
31 e.target.seekingCount +=
1;
34 v.addEventListener(
"seeked", function (e) {
35 e.target.seekedCount +=
1;
36 if (e.target.seekedCount ==
3) {
37 ok(e.target.seekingCount ==
3,
"Expect matched pairs of seeking/seeked events.");
38 e.target.loop = false;
42 v.addEventListener(
"ended", function (e) {
43 ok(!e.target.loop,
"Shouldn't get ended event while looping.");
44 e.target.parentNode.removeChild(v);
45 manager.finished(e.target.token);
48 document.body.appendChild(v);
52 manager.runTests(gSmallTests, startTest);