16c093ab1a0a7136290bc2389ca1ac1f80bbdc93
[WebKit-https.git] / LayoutTests / fast / speech / speech-input-result-list-not-enough-arguments.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script type="text/javascript">
8 description('Tests for SpeechInputResultList\' behavior with too few arguments.');
9
10 var speechInputCreatedByScript = false;
11
12 function onWebkitSpeechChange() {
13     shouldThrow('window.event.results.item()');
14     finishJSTest();
15 }
16
17 function run() {
18     if (!window.testRunner || !window.eventSender)
19         return;
20
21     testRunner.addMockSpeechInputResult('Pictures of the moon', 1.0, '');
22     var input = document.getElementById('speechInput');
23     input.addEventListener('webkitspeechchange', onWebkitSpeechChange);
24     var x = input.offsetLeft + input.offsetWidth - 8;
25     var y = input.offsetTop + input.offsetHeight / 2;
26     eventSender.mouseMoveTo(x, y);
27     eventSender.mouseDown();
28     eventSender.mouseUp();
29 }
30
31 window.onload = run;
32 window.jsTestIsAsync = true;
33 </script>
34 <script src="../js/resources/js-test-post.js"></script>
35 <input id='speechInput' x-webkit-speech>
36 </body>
37 </html>