Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Side by Side Diff: LayoutTests/fast/speech/input-onspeechchange-event.html

Issue 22208002: Drop [IsIndex] IDL extended attribute from Speech types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Stop using window.event Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/speech/input-onspeechchange-event-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../js/resources/js-test-pre.js"></script> 4 <script src="../js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script type="text/javascript"> 7 <script type="text/javascript">
8 description('Tests for the onspeechchange event with &lt;input type="text" speec h>.'); 8 description('Tests for the onspeechchange event with &lt;input type="text" speec h>.');
9 9
10 function onSpeechChange() { 10 var results;
11 function onSpeechChange(event) {
12 results = event.results;
11 shouldBeEqualToString('document.getElementById("speechInput").value', 'Green eggs and ham'); 13 shouldBeEqualToString('document.getElementById("speechInput").value', 'Green eggs and ham');
12 shouldEvaluateTo('window.event.results.length', 3); 14 shouldEvaluateTo('results.length', 3);
13 shouldBeEqualToString('window.event.results[0].utterance', 'Green eggs and h am'); 15 shouldBeEqualToString('results[0].utterance', 'Green eggs and ham');
14 shouldEvaluateTo('window.event.results[0].confidence', 0.8); 16 shouldEvaluateTo('results[0].confidence', 0.8);
15 shouldBeEqualToString('window.event.results[1].utterance', 'Green x and ham' ); 17 shouldBeEqualToString('results[1].utterance', 'Green x and ham');
16 shouldEvaluateTo('window.event.results[1].confidence', 0.5); 18 shouldEvaluateTo('results[1].confidence', 0.5);
17 shouldBeEqualToString('window.event.results[2].utterance', '3 x and am'); 19 shouldBeEqualToString('results[2].utterance', '3 x and am');
18 shouldEvaluateTo('window.event.results[2].confidence', 0.2); 20 shouldEvaluateTo('results[2].confidence', 0.2);
21 shouldBeNull("results.item(-1)");
19 finishJSTest(); 22 finishJSTest();
20 } 23 }
21 24
22 function run() { 25 function run() {
23 if (window.testRunner && window.eventSender) { 26 if (window.testRunner && window.eventSender) {
24 testRunner.addMockSpeechInputResult('Green eggs and ham', 0.8, ''); 27 testRunner.addMockSpeechInputResult('Green eggs and ham', 0.8, '');
25 testRunner.addMockSpeechInputResult('Green x and ham', 0.5, ''); 28 testRunner.addMockSpeechInputResult('Green x and ham', 0.5, '');
26 testRunner.addMockSpeechInputResult('3 x and am', 0.2, ''); 29 testRunner.addMockSpeechInputResult('3 x and am', 0.2, '');
27 30
28 // Clicking the speech button should fill in mock speech-recognized text . 31 // Clicking the speech button should fill in mock speech-recognized text .
29 var input = document.getElementById('speechInput'); 32 var input = document.getElementById('speechInput');
30 var x = input.offsetLeft + input.offsetWidth - 4; 33 var x = input.offsetLeft + input.offsetWidth - 4;
31 var y = input.offsetTop + input.offsetHeight / 2; 34 var y = input.offsetTop + input.offsetHeight / 2;
32 eventSender.mouseMoveTo(x, y); 35 eventSender.mouseMoveTo(x, y);
33 eventSender.mouseDown(); 36 eventSender.mouseDown();
34 eventSender.mouseUp(); 37 eventSender.mouseUp();
35 } 38 }
36 } 39 }
37 40
38 window.onload = run; 41 window.onload = run;
39 window.jsTestIsAsync = true; 42 window.jsTestIsAsync = true;
40 </script> 43 </script>
41 <script src="../js/resources/js-test-post.js"></script> 44 <script src="../js/resources/js-test-post.js"></script>
42 <input id='speechInput' x-webkit-speech onwebkitspeechchange="onSpeechChange()"> 45 <input id='speechInput' x-webkit-speech onwebkitspeechchange="onSpeechChange(eve nt)">
43 </body> 46 </body>
44 </html> 47 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/speech/input-onspeechchange-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698