Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/forms/radio/rtl-radio-buttons-key-event.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/forms/radio/rtl-radio-buttons-key-event.html b/third_party/WebKit/LayoutTests/fast/forms/radio/rtl-radio-buttons-key-event.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..37c90c9487361a27aa8c34a42a52db241b2d36eb |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/forms/radio/rtl-radio-buttons-key-event.html |
| @@ -0,0 +1,103 @@ |
| +<!DOCTYPE html> |
|
tkent
2016/02/03 23:45:37
Probably you copied radio-group-keyboard-change-ev
chakshu
2016/02/08 09:46:39
Done.
|
| +<html> |
| +<body> |
| + |
| +<p>Test for <a href="https://code.google.com/p/chromium/issues/detail?id=556677">https://code.google.com/p/chromium/issues/detail?id=556677</a>. |
| + |
| +<p>For manual testing, focus a radio button in the first group and use the arrow keys. Changing the |
| +radio button should fire change events in the direction of left to right. |
| + |
| +<p> |
| +<div dir="auto"> |
| + <label><input type="radio" value="אחד" onchange="handleChange(event)" name="r">אחד</label> |
|
tkent
2016/02/03 23:45:37
I guess the text direction of these INPUT elements
chakshu
2016/02/08 09:46:39
Done.
|
| + <label><input type="radio" value="שני" onchange="handleChange(event)" name="r">שני</label> |
| + <label><input type="radio" value="שלוש" onchange="handleChange(event)" name="r">שלוש</label> |
| +</div> |
| + |
| +<p>For manual testing, focus a radio button in the second group and use the arrow keys. Changing the |
| +radio button should fire change events in the direction of left to right. |
| + |
| +<p> |
| +<div dir="auto"> |
| + <label><input type="radio" value="one" onchange="handleChange(event)" name="l">one</label> |
| + <label><input type="radio" value="two" onchange="handleChange(event)" name="l">two</label> |
| + <label><input type="radio" value="three" onchange="handleChange(event)" name="l">three</label> |
| +</div> |
| + |
| +<pre id=out></pre> |
| +<script> |
| + |
| +function handleChange(e) |
| +{ |
| + var value = e.target.value; |
| + print(value + ' dispatched change event'); |
| +} |
| + |
| +function print(s) |
| +{ |
| + document.getElementById('out').textContent += s + '\n'; |
| +} |
| + |
| +function pass(s) { |
| + print('PASS: ' + s); |
| +} |
| + |
| +function fail(s) { |
| + print('FAIL: ' + s); |
| +} |
| + |
| +function getRadio(value) |
| +{ |
| + return document.querySelector('input[value="' + value + '"]'); |
| +} |
| + |
| +function assertChecked(value) |
| +{ |
| + if (getRadio(value).checked) |
| + pass(value + ' is checked'); |
| + else |
| + fail(value + ' should be checked'); |
| +} |
| + |
| +function assertNotChecked(value) |
| +{ |
| + if (!getRadio(value).checked) |
| + pass(value + ' is not checked'); |
| + else |
| + fail(value + ' should not be checked'); |
| +} |
| + |
| +if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + |
| +if (window.eventSender) { |
| + getRadio('אחד').focus(); |
| + eventSender.keyDown('downArrow'); |
| + |
| + assertNotChecked('אחד'); |
| + assertChecked('שני'); |
| + assertNotChecked('שלוש'); |
| + |
| + eventSender.keyDown('downArrow'); |
| + |
| + assertNotChecked('אחד'); |
| + assertNotChecked('שני'); |
| + assertChecked('שלוש'); |
| + |
| + getRadio('one').focus(); |
| + eventSender.keyDown('downArrow'); |
| + |
| + assertNotChecked('one'); |
| + assertChecked('two'); |
| + assertNotChecked('three'); |
| + |
| + eventSender.keyDown('downArrow'); |
| + |
| + assertNotChecked('one'); |
| + assertNotChecked('two'); |
| + assertChecked('three'); |
| +} |
| + |
| +</script> |
| +</body> |
| +</html> |