OLD | NEW |
| (Empty) |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 </head> | |
6 <body> | |
7 <script type="text/javascript"> | |
8 description('Tests for speech button click with readonly and disabled input fiel
ds.'); | |
9 | |
10 function onWebkitSpeechChange() { | |
11 testFailed('Received unexpected onwebkitspeechchange callback.'); | |
12 finishJSTest(); | |
13 } | |
14 | |
15 function testField(index) { | |
16 // Clicking the speech button should fill in mock speech-recognized text. | |
17 var allInputFields = document.getElementsByTagName('input'); | |
18 var input = allInputFields[index]; | |
19 var x = input.offsetLeft + input.offsetWidth - 4; | |
20 var y = input.offsetTop + input.offsetHeight / 2; | |
21 eventSender.mouseMoveTo(x, y); | |
22 eventSender.mouseDown(); | |
23 eventSender.mouseUp(); | |
24 setTimeout(function() { | |
25 if (index < allInputFields.length - 1) { | |
26 testField(index +1); | |
27 } else { | |
28 finishJSTest(); | |
29 } | |
30 }, 50); | |
31 } | |
32 | |
33 function run() { | |
34 if (window.testRunner && window.eventSender) { | |
35 testRunner.addMockSpeechInputResult('Test', 1.0, ''); | |
36 testField(0); | |
37 } | |
38 } | |
39 | |
40 window.onload = run; | |
41 window.jsTestIsAsync = true; | |
42 </script> | |
43 <input id='readonlyInput' x-webkit-speech onwebkitspeechchange="onWebkitSpeechCh
ange()" readonly> | |
44 <input id='disabledInput' x-webkit-speech onwebkitspeechchange="onWebkitSpeechCh
ange()" disabled> | |
45 </body> | |
46 </html> | |
OLD | NEW |