1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../../resources/js-test.js"></script>
7 <script type=
"text/javascript">
8 description('Tests the basics of the Speech JavaScript API');
11 // Check availability of constructors.
12 shouldBeTrue("'webkitSpeechRecognition' in self");
13 shouldBeFalse("webkitSpeechRecognition == null");
15 // Check for members of SpeechRecognition.
16 window
.speechReco
= new webkitSpeechRecognition();
17 shouldBeFalse("speechReco == null");
18 shouldBeTrue("'grammars' in speechReco");
19 shouldBeFalse("speechReco.grammars == null");
20 shouldBeTrue("speechReco.grammars.length === 0");
21 shouldBeTrue("'lang' in speechReco");
22 shouldBeTrue("'continuous' in speechReco");
23 shouldBeTrue("'interimResults' in speechReco");
24 shouldBeTrue("'maxAlternatives' in speechReco");
25 shouldBeTrue("'start' in speechReco");
26 shouldBeTrue("'stop' in speechReco");
27 shouldBeTrue("'abort' in speechReco");
28 shouldBeTrue("'onaudiostart' in speechReco");
29 shouldBeTrue("'onsoundstart' in speechReco");
30 shouldBeTrue("'onspeechstart' in speechReco");
31 shouldBeTrue("'onspeechend' in speechReco");
32 shouldBeTrue("'onsoundend' in speechReco");
33 shouldBeTrue("'onaudioend' in speechReco");
34 shouldBeTrue("'onresult' in speechReco");
35 shouldBeTrue("'onnomatch' in speechReco");
36 shouldBeTrue("'onerror' in speechReco");
37 shouldBeTrue("'onstart' in speechReco");
38 shouldBeTrue("'onend' in speechReco");
40 shouldBeTrue("'addEventListener' in speechReco");
41 shouldBeTrue("'removeEventListener' in speechReco");
42 shouldBeTrue("'dispatchEvent' in speechReco");
44 // Check default values.
45 // FIXME: The spec should say what the default value for .grammars is.
46 shouldBe("speechReco.lang", "''");
47 shouldBe("speechReco.continuous", "false");
48 shouldBe("speechReco.maxAlternatives", "1");
54 window
.jsTestIsAsync
= true;