summaryrefslogtreecommitdiffstats
path: root/toolkit/content/tests/widgets/test_videocontrols_audio.html
blob: 0a7a2dcbc3ccbbd8e0f59ff7957accb13c881dcb (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
39
40
<!DOCTYPE HTML>
<html>
<head>
  <title>Video controls with Audio file test</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <script src="/tests/SimpleTest/EventUtils.js"></script>
  <script src="head.js"></script>
  <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>

<div id="content">
  <video id="video" controls preload="metadata"></video>
</div>

<pre id="test">
<script>

  const video = document.getElementById("video");
  function loadedmetadata() {
    SimpleTest.executeSoon(function() {
      const controlBar = SpecialPowers.wrap(video).openOrClosedShadowRoot.querySelector(".controlBar");
      is(controlBar.getAttribute("fullscreen-unavailable"), "true", "Fullscreen button is hidden");
      SimpleTest.finish();
    });
  }

  SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, startTest);
  function startTest() {
    // Kick off test once audio has loaded.
    video.addEventListener("loadedmetadata", loadedmetadata, { once: true });
    video.src = "audio.ogg";
  }

  SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>