tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / forms / script-tests / input-spinbutton-capturing.js
1 description('Test for a capturing bug of spin buttons in a type=numnber input.');
2
3 var parent = document.createElement('div');
4 document.body.appendChild(parent);
5 parent.innerHTML = '<input type=number id=number value=0 min=0 max=100><input type=number id=another value=1 min=0 max=100>';
6 var numberInput = document.getElementById('number');
7 var anotherInput = document.getElementById('another');
8
9 if (window.eventSender) {
10     // Move the cursor on the upper button of the first input field.
11     eventSender.mouseMoveTo(numberInput.offsetLeft + numberInput.offsetWidth - 10, numberInput.offsetTop + numberInput.offsetHeight / 4);
12
13     // Move the cursor on the upper button of another input field, and click.
14     // There was a bug that a capturing flag of the first input field was not
15     // clear and this click didn't work.
16     eventSender.mouseMoveTo(anotherInput.offsetLeft + anotherInput.offsetWidth - 10, anotherInput.offsetTop + anotherInput.offsetHeight / 4);
17     eventSender.mouseMoveTo(anotherInput.offsetLeft + anotherInput.offsetWidth - 10, anotherInput.offsetTop + anotherInput.offsetHeight / 4 - 1);
18     eventSender.mouseDown();
19     eventSender.mouseUp();
20     shouldBe('anotherInput.value', '"2"');
21
22     parent.innerHTML = '';
23 } else {
24     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.';
25 }