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

Side by Side Diff: LayoutTests/fast/speech/bubble-position-scrolled.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 onSpeechChange() {
11 debug('onSpeechChange');
12 var rect = input.value.split(',');
13 var x = parseInt(rect[0]);
14 var y = parseInt(rect[1]);
15
16 if (Math.abs(x - clickTargetX) > 20) {
17 testFailed('x too far away from clickTargetX');
18 debug('x: ' + x + ' clickTargetX: ' + clickTargetX);
19 } else {
20 debug('x OK');
21 }
22
23 if (Math.abs(y - clickTargetY) > 20) {
24 testFailed('y too far away from clickTargetY');
25 debug('y: ' + y + ' clickTargetY: ' + clickTargetY);
26 } else {
27 debug('y OK');
28 }
29
30 finishJSTest();
31 }
32
33 function run() {
34 window.input = document.getElementsByTagName('input')[0];
35 input.onwebkitspeechchange = onSpeechChange;
36
37 var scrollAmount = 100;
38 window.scrollTo(0, scrollAmount);
39
40 if (window.testRunner && window.eventSender) {
41 testRunner.setMockSpeechInputDumpRect(true);
42 debug('Clicking the speech button.');
43
44 window.clickTargetX = input.offsetLeft + input.offsetWidth - 4;
45 window.clickTargetY = input.offsetTop + input.offsetHeight / 2;
46
47 clickTargetY -= scrollAmount;
48
49 eventSender.mouseMoveTo(clickTargetX, clickTargetY);
50 eventSender.mouseDown();
51 eventSender.mouseUp();
52 }
53 }
54
55 window.onload = run;
56 window.jsTestIsAsync = true;
57 </script>
58 <div style="height: 200px"></div>
59 <input x-webkit-speech>
60 <div style="height: 1000px"></div>
61 </body>
62 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/speech/bubble-position-expected.txt ('k') | LayoutTests/fast/speech/bubble-position-scrolled-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698