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

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

Issue 264973003: Remove layout tests for the legacy x-webkit-speech API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
OLDNEW
(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 the onspeechchange event with &lt;input type="text" speec h>.');
9
10 var results;
11 function onSpeechChange(event) {
12 results = event.results;
13 shouldBeEqualToString('document.getElementById("speechInput").value', 'Green eggs and ham');
14 shouldEvaluateTo('results.length', 3);
15 shouldBeEqualToString('results[0].utterance', 'Green eggs and ham');
16 shouldEvaluateTo('results[0].confidence', 0.8);
17 shouldBeEqualToString('results[1].utterance', 'Green x and ham');
18 shouldEvaluateTo('results[1].confidence', 0.5);
19 shouldBeEqualToString('results[2].utterance', '3 x and am');
20 shouldEvaluateTo('results[2].confidence', 0.2);
21 shouldBeNull("results.item(-1)");
22 finishJSTest();
23 }
24
25 function run() {
26 if (window.testRunner && window.eventSender) {
27 testRunner.addMockSpeechInputResult('Green eggs and ham', 0.8, '');
28 testRunner.addMockSpeechInputResult('Green x and ham', 0.5, '');
29 testRunner.addMockSpeechInputResult('3 x and am', 0.2, '');
30
31 // Clicking the speech button should fill in mock speech-recognized text .
32 var input = document.getElementById('speechInput');
33 var x = input.offsetLeft + input.offsetWidth - 4;
34 var y = input.offsetTop + input.offsetHeight / 2;
35 eventSender.mouseMoveTo(x, y);
36 eventSender.mouseDown();
37 eventSender.mouseUp();
38 }
39 }
40
41 window.onload = run;
42 window.jsTestIsAsync = true;
43 </script>
44 <input id='speechInput' x-webkit-speech onwebkitspeechchange="onSpeechChange(eve nt)">
45 </body>
46 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698