Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / number / number-spinbutton-capturing.html
bloba6c38aa42bb5cfa5a2adf59dc9807db29d9748f1
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Test for a capturing bug of spin buttons in a type=numnber input.');
10 var parent = document.createElement('div');
11 document.body.appendChild(parent);
12 parent.innerHTML = '<input type=number id=number value=0 min=0 max=100><input type=number id=another value=1 min=0 max=100>';
13 var numberInput = document.getElementById('number');
14 var anotherInput = document.getElementById('another');
16 if (window.eventSender) {
17 // Reset mouse position
18 eventSender.mouseMoveTo(0, 0);
20 // Move the cursor on the upper button of the first input field.
21 eventSender.mouseMoveTo(numberInput.offsetLeft + numberInput.offsetWidth - 10, numberInput.offsetTop + numberInput.offsetHeight / 4);
23 // Move the cursor on the upper button of another input field, and click.
24 // There was a bug that a capturing flag of the first input field was not
25 // clear and this click didn't work.
26 eventSender.mouseMoveTo(anotherInput.offsetLeft + anotherInput.offsetWidth - 10, anotherInput.offsetTop + anotherInput.offsetHeight / 4);
27 eventSender.mouseMoveTo(anotherInput.offsetLeft + anotherInput.offsetWidth - 10, anotherInput.offsetTop + anotherInput.offsetHeight / 4 - 1);
28 eventSender.mouseDown();
29 eventSender.mouseUp();
30 shouldBe('anotherInput.value', '"2"');
32 parent.innerHTML = '';
33 } else {
34 document.getElementById('console').innerHTML = '<p>No eventSender. <p>Manual test instruction: Click the upper button of the first input field, then click the upper button of the second input field. Confirm that the second input field value is changed.';
36 </script>
37 </body>
38 </html>