Simulate user inputs in css/selectors/focus-visible-001.html

Use testdriver Action API to simulate key actions in
css/selectors/focus-visible-001.html.

Bug: 1145677
Change-Id: I5f39a03b41624e2a12c523dc9b1a0a509925621a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546602
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831103}
diff --git a/css/selectors/focus-visible-001-manual.html b/css/selectors/focus-visible-001.html
similarity index 81%
rename from css/selectors/focus-visible-001-manual.html
rename to css/selectors/focus-visible-001.html
index 3475ba6..2afcea2 100644
--- a/css/selectors/focus-visible-001-manual.html
+++ b/css/selectors/focus-visible-001.html
@@ -7,6 +7,9 @@
   <link rel="help" href="https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo" />
   <script src="/resources/testharness.js"></script>
   <script src="/resources/testharnessreport.js"></script>
+  <script src="/resources/testdriver.js"></script>
+  <script src="/resources/testdriver-actions.js"></script>
+  <script src="/resources/testdriver-vendor.js"></script>
   <style>
     :focus-visible {
       outline: darkgreen dotted 1px; /* fallback for Edge */
@@ -34,6 +37,9 @@
         assert_equals(getComputedStyle(el).outlineColor, "rgb(0, 100, 0)");
         t.done();
       }));
+      const tab_key = '\ue004';
+      test_driver.send_keys(el, tab_key)
+        .catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e)));
     }, "Keyboard focus should match :focus-visible");
   </script>
 </body>