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

Side by Side Diff: LayoutTests/fast/speech/change-focus.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 speech button click with &lt;input type="text" speech>.') ;
9
10 function startSpeechInput(id) {
11 // Clicking the speech button should fill in mock speech-recognized text.
12 debug('Clicking on speech button.');
13 var input = document.getElementById(id);
14 var isRTL = input.dir == 'rtl';
15 var x = 0;
16 if (isRTL)
17 x = input.offsetLeft + 4;
18 else
19 x = input.offsetLeft + input.offsetWidth - 4;
20 var y = input.offsetTop + input.offsetHeight / 2;
21 if (!isRTL && input.style.paddingRight.length)
22 x -= parseInt(input.style.paddingRight.substr(0, input.style.paddingRigh t.length - 2));
23 else if (isRTL && input.style.paddingLeft.length)
24 x += parseInt(input.style.paddingLeft.substr(0, input.style.paddingLeft. length - 2));
25 eventSender.mouseMoveTo(x, y);
26 eventSender.mouseDown();
27 eventSender.mouseUp();
28 }
29
30 function run() {
31 if (window.testRunner && window.eventSender) {
32 testRunner.addMockSpeechInputResult('Pictures of the moon', 1.0, '');
33 startSpeechInput('input1');
34 }
35 }
36
37 function onFocus() {
38 document.getElementById('input2').focus();
39 }
40
41 function onSpeechChange() {
42 shouldBeEqualToString('document.getElementById("input1").value', 'Pictures o f the moon');
43 shouldBeEqualToString('document.getElementById("input2").value', '');
44 finishJSTest();
45 }
46
47 window.onload = run;
48 window.jsTestIsAsync = true;
49 </script>
50 <input id='input1' x-webkit-speech onfocus="onFocus()" onwebkitspeechchange="onS peechChange()">
51 <input id='input2'>
52 </body>
53 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/speech/bubble-position-scrolled-expected.txt ('k') | LayoutTests/fast/speech/change-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698