summaryrefslogtreecommitdiffstats
path: root/dom/browser-element/mochitest/file_browserElement_NoAudioTrack.html
blob: 14304e46975f2323ab4d0335071c7369c50993cb (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
<!DOCTYPE HTML>
<html>
<body>
<script type="application/javascript;version=1.7">
var audio = new Audio();
audio.src = "noaudio.webm";
audio.preload = "none";
audio.loop = true;

function ok(aVal, aMsg) {
  alert((!!aVal ? "OK" : "KO") + ", " + aMsg);
}

function runCommands()
{
  switch(location.hash) {
    case '#play':
      audio.play();
      ok(true, "Start playing a video without audio track!");
      break;
    case '#idle':
      ok(!audio.paused, "Video is still playing!");
      break;
    default :
      ok(false, "Undefined command!");
  }
}

window.addEventListener('hashchange', runCommands);
</script>
</body>
</html>