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

Unified Diff: LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html

Issue 619613005: The link should be activated by enter key on focusing the child element inside the anchor(relanding) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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: LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html
diff --git a/LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html b/LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html
new file mode 100644
index 0000000000000000000000000000000000000000..3428ea14a64ce7141024944e2e3af5067caba8b4
--- /dev/null
+++ b/LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<a id="before" href="#">Before</a>
+<a id="target" href="#" tabindex="-1"><h1 tabindex="0">EnterMe</h1></a>
+<script>
+ description("This test ensures that the link is activated by enter key on focusing the child element inside the anchor");
+ var clicked = false;
+ document.getElementById('before').focus();
+ document.getElementById('target').addEventListener('click', function() { clicked = true; });
+
+ if (window.eventSender) {
+ eventSender.keyDown('\t');
+ eventSender.keyDown('\r');
+ }
+ shouldBe("clicked", "true");
+</script>

Powered by Google App Engine
This is Rietveld 408576698