summaryrefslogtreecommitdiffstats
path: root/webkit/data/media/manybear.html
blob: 2ebf5ffe532b9ea88409622dedd0ac140df4ddb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<body>
<div id="container"></div>
<script>
  layoutTestController.waitUntilDone();

  var count = 0;
  var file = "bear_silent.ogv";

  function loop() {
    var c = document.getElementById('container');
    var v = null;

    if (c.childNodes != null && c.childNodes.length > 0) {
      v = c.childNodes[0];
    }

    // If there is a video tag as child, remove it.
    if (v) {
      c.removeChild(v);
      window.setTimeout(function () { loop(); }, 0);
    } else {
      v = document.createElement("video");
      c.appendChild(v);
      v.src = file;
      v.addEventListener("canplaythrough", function () { loop(); }, false);
      v.load();
    }

    if (count++ == 50) {
      layoutTestController.notifyDone();
    }
  }

  loop();
</script>
</body>
</html>