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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/radio/rtl-radio-buttons-key-event.html

Issue 1633553002: Change in focus with movement of Arrow keys for RTL radio buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698