Index: LayoutTests/fast/events/anchor-empty-focus.html |
diff --git a/LayoutTests/fast/events/anchor-empty-focus.html b/LayoutTests/fast/events/anchor-empty-focus.html |
index 9436397749fa5685bf609c83b8dc74c47b4044b8..7692577421efc17108c92a97782d68c4844387d8 100644 |
--- a/LayoutTests/fast/events/anchor-empty-focus.html |
+++ b/LayoutTests/fast/events/anchor-empty-focus.html |
@@ -1,20 +1,27 @@ |
<html> |
- <head> |
- <script> |
- function test() |
- { |
- document.getElementById("anch").focus(); |
- if (window.testRunner) { |
- testRunner.dumpAsText(); |
- eventSender.keyDown('s'); |
- } |
- } |
- </script> |
- </head> |
- <body onload="test()"> |
- This tests that focus() works on an empty anchor.<br> |
- <a id="anch" href="#" onkeydown="document.getElementById('console').innerText = 'TEST PASSED'"></a> |
- <br> |
- <pre id="console">TEST FAILED</pre> |
- </body> |
+<head> |
+<script src="../js/resources/js-test-pre.js"></script> |
+</head> |
+<body onload="test()"> |
+<a id="anch" href="#"></a> |
+<a id="anch2" href="#"></a> |
+<input> |
+ |
+<script> |
+description('This tests that focus() and sequential focus navigation work on empty anchors.'); |
+jsTestIsAsync = true; |
+var emptyAnchor1 = document.getElementById("anch"); |
+var emptyAnchor2 = document.getElementById("anch2"); |
+function test() { |
+ emptyAnchor1.focus(); |
+ shouldBe('document.activeElement', 'emptyAnchor1'); |
+ |
+ testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true); |
+ eventSender.keyDown('\t'); |
+ shouldBe('document.activeElement', 'emptyAnchor2'); |
+ finishJSTest(); |
+} |
+</script> |
+<script src="../js/resources/js-test-post.js"></script> |
+</body> |
</html> |