summaryrefslogtreecommitdiffstats
path: root/dom/media/webspeech/synth/test/startup/file_voiceschanged.html
blob: 6bb25462e431ddd294b4e89e39d58ea647f88a0b (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>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1254378
-->
<head>
  <meta charset="utf-8">
  <title>Test for Bug 1254378: Web Speech API check all classes are present</title>
  <script type="application/javascript">
    window.SimpleTest = parent.SimpleTest;
    window.is = parent.is;
    window.isnot = parent.isnot;
    window.ok = parent.ok;
  </script>
</head>
<body>
<script type="application/javascript">

/** Test for Bug 1254378 **/

function onVoicesChanged() {
  isnot(speechSynthesis.getVoices().length, 0, "Voices added");
  speechSynthesis.removeEventListener("voiceschanged", onVoicesChanged);
  SimpleTest.finish();
}

speechSynthesis.addEventListener("voiceschanged", onVoicesChanged);

is(speechSynthesis.getVoices().length, 0, "No voices added initially");
</script>
</body>
</html>