summaryrefslogtreecommitdiffstats
path: root/dom/media/webspeech/synth/crashtests/1230428.html
blob: 40fa000710342ba42962540f0190e4691265b0cb (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 class="reftest-wait">
<head>
<meta charset="utf-8">
<script type="application/javascript">
function f()
{
  if (speechSynthesis.getVoices().length == 0) {
    // No synthesis backend to test this
    document.documentElement.removeAttribute('class');
    return;
  }

  var s = new SpeechSynthesisUtterance("hello world");
  s.onerror = () => {
    // No synthesis backend to test this
    document.documentElement.removeAttribute('class');
    return;
  }
  s.onend = () => {
    document.documentElement.removeAttribute('class');
  };
  speechSynthesis.speak(s);
  speechSynthesis.cancel();
  speechSynthesis.pause();
  speechSynthesis.resume();
}
  </script>
</head>
<body onload="f();">
</body>
</html>