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

Side by Side Diff: LayoutTests/fast/speech/input-ontextinput-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>
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 ontextInput event with &lt;input type="text" speech>. ');
9
10 function onTextInput() {
11 shouldBeEqualToString('document.getElementById("speechInput").value', '');
12 shouldBeEqualToString('window.event.data', 'Green eggs and ham');
13
14 // Set to undefined to make this test fail if it's implemented, so it can be properly set to the correct value once it's available.
15 shouldBe('window.event.inputMethod', 'undefined');
16
17 finishJSTest();
18 }
19
20 function run() {
21 if (window.testRunner && window.eventSender) {
22 testRunner.addMockSpeechInputResult('Green eggs and ham', 0.8, '');
23 testRunner.addMockSpeechInputResult('Green x and ham', 0.5, '');
24
25 // Clicking the speech button should fill in mock speech-recognized text .
26 var input = document.getElementById('speechInput');
27 input.addEventListener("textInput", onTextInput, false);
28
29 var x = input.offsetLeft + input.offsetWidth - 4;
30 var y = input.offsetTop + input.offsetHeight / 2;
31 eventSender.mouseMoveTo(x, y);
32 eventSender.mouseDown();
33 eventSender.mouseUp();
34 }
35 }
36
37 window.onload = run;
38 window.jsTestIsAsync = true;
39 </script>
40 <input id='speechInput' x-webkit-speech>
41 </body>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698