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

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..a1ad01a94128549aa22236b8e54fff62f5412e19
--- /dev/null
+++ b/LayoutTests/fast/events/keydown-enter-key-on-focused-element-inside-link.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
robwu 2014/10/13 09:19:48 This file should be renamed to "keypress-enter....
Miyoung Shin(g) 2014/10/13 11:05:01 Oh, right, I will change it
+<script src="../../resources/js-test.js"></script>
+<a id="link" href="#" tabindex="-1" onclick="checkKeyEvent(event)">
+ <h1 tabindex="1">EnterMe</h1>
+</a>
+<div id="console"></div>
+<script>
+ description("This test ensures that the link is activated by enter key on focusing the child element inside the anchor");
+
+ var i = 0;
+ function test() {
+ if (window.eventSender)
+ eventSender.keyDown('\t');
+ var event = document.createEvent("KeyboardEvents");
+ event.initKeyboardEvent("keypress", true, true, window, "Enter", 0, 0, 0, 0, 0, false);
+ document.activeElement.dispatchEvent(event);
robwu 2014/10/13 09:19:48 You should also be simulating the keydown/keyup ev
Miyoung Shin(g) 2014/10/13 11:05:01 OK. I will add keydown/keyup as well
robwu 2014/10/13 11:29:32 The test code in the following files suggest that
+ }
+ function checkKeyEvent(event) {
+ debug("PASS : [" + document.activeElement.localName + "], link is activated")
+ }
+ test();
+</script>

Powered by Google App Engine
This is Rietveld 408576698