Title: [189440] trunk/LayoutTests
Revision
189440
Author
[email protected]
Date
2015-09-05 13:54:31 -0700 (Sat, 05 Sep 2015)

Log Message

Import a couple of Chromium accesskey tests.
https://bugs.webkit.org/show_bug.cgi?id=148865

Reviewed by Daniel Bates.

* fast/forms/access-key-case-insensitive-expected.txt: Added.
* fast/forms/access-key-case-insensitive.html: Added.
* fast/forms/access-key-mutated-expected.txt: Added.
* fast/forms/access-key-mutated.html: Added.
* platform/ios-simulator/TestExpectations:
These tests are asynchronous and use unsupported features; skip them on
iOS so they don't time out.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (189439 => 189440)


--- trunk/LayoutTests/ChangeLog	2015-09-05 19:45:58 UTC (rev 189439)
+++ trunk/LayoutTests/ChangeLog	2015-09-05 20:54:31 UTC (rev 189440)
@@ -1,3 +1,18 @@
+2015-09-04  Jon Honeycutt  <[email protected]>
+
+        Import a couple of Chromium accesskey tests.
+        https://bugs.webkit.org/show_bug.cgi?id=148865
+
+        Reviewed by Daniel Bates.
+
+        * fast/forms/access-key-case-insensitive-expected.txt: Added.
+        * fast/forms/access-key-case-insensitive.html: Added.
+        * fast/forms/access-key-mutated-expected.txt: Added.
+        * fast/forms/access-key-mutated.html: Added.
+        * platform/ios-simulator/TestExpectations:
+        These tests are asynchronous and use unsupported features; skip them on
+        iOS so they don't time out.
+
 2015-09-05  Chris Dumez  <[email protected]>
 
         Unreviewed, skip http/tests/w3c/html/semantics/embedded-content/media-elements/* tests on Win/Debug.

Added: trunk/LayoutTests/fast/forms/access-key-case-insensitive-expected.txt (0 => 189440)


--- trunk/LayoutTests/fast/forms/access-key-case-insensitive-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/access-key-case-insensitive-expected.txt	2015-09-05 20:54:31 UTC (rev 189440)
@@ -0,0 +1,12 @@
+Access key should work case-insensitively. To test this manually, press <alt>+a, <alt>+<shift>+b and <alt>+<shift>+c keys in this order (on Mac OS X, press <ctrl>+<opt> instead of <alt>).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Pressing the "a" access key triggered a focus event.
+PASS Pressing the "B" access key triggered a focus event.
+PASS Pressing the "C" access key triggered a focus event.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/forms/access-key-case-insensitive.html (0 => 189440)


--- trunk/LayoutTests/fast/forms/access-key-case-insensitive.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/access-key-case-insensitive.html	2015-09-05 20:54:31 UTC (rev 189440)
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Case insensitiveness of accesskey attribute</title>
+<script src=""
+</head>
+</head>
+<body>
+<script>
+description('Access key should work case-insensitively. To test this manually, press &lt;alt&gt;+a, &lt;alt&gt;+&lt;shift&gt;+b and &lt;alt&gt;+&lt;shift&gt;+c keys in this order (on Mac OS X, press &lt;ctrl&gt;+&lt;opt&gt; instead of &lt;alt&gt;).');
+
+window.jsTestIsAsync = true;
+
+function isUpperCase(string)
+{
+    return string === string.toUpperCase();
+}
+
+function pressKey(key)
+{
+    var modifiers;
+    if (navigator.userAgent.search(/\bMac OS X\b/) !== -1)
+        modifiers = ["ctrlKey", "altKey"];
+    else
+        modifiers = ["altKey"];
+
+    if (isUpperCase(key)) {
+        modifiers.push("shiftKey");
+        key = key.toLowerCase();
+    }
+
+    if (window.eventSender)
+        eventSender.keyDown(key, modifiers);
+}
+
+document.addEventListener("DOMContentLoaded", function () {
+    var input = document.createElement('input');
+    input.accessKey = 'A';
+    input._onfocus_ = function () {
+        testPassed('Pressing the "a" access key triggered a focus event.');
+        input.blur();
+        input.accessKey = 'b';
+        input._onfocus_ = function () {
+            testPassed('Pressing the "B" access key triggered a focus event.');
+            input.blur();
+            input.setAttribute('accesskey', 'C');
+            input._onfocus_ = function () {
+                testPassed('Pressing the "C" access key triggered a focus event.');
+                document.body.removeChild(input);
+                finishJSTest();
+            };
+            pressKey('C');
+        };
+        pressKey('B');
+    };
+    document.body.appendChild(input);
+    pressKey('a');
+});
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/access-key-mutated-expected.txt (0 => 189440)


--- trunk/LayoutTests/fast/forms/access-key-mutated-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/access-key-mutated-expected.txt	2015-09-05 20:54:31 UTC (rev 189440)
@@ -0,0 +1,12 @@
+Access key should work after accesskey attribute is mutated. To test this manually, press <alt>+a, <alt>+b and <alt>+c keys in this order (on Mac OS X, press <Ctrl>+<Opt> instead of <alt>).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Pressing the "a" access key triggered a focus event.
+PASS Pressing the "b" access key triggered a focus event.
+PASS Pressing the "c" access key triggered a focus event.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/forms/access-key-mutated.html (0 => 189440)


--- trunk/LayoutTests/fast/forms/access-key-mutated.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/access-key-mutated.html	2015-09-05 20:54:31 UTC (rev 189440)
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Mutating accesskey attribute</title>
+<script src=""
+</head>
+</head>
+<body>
+<script>
+description('Access key should work after accesskey attribute is mutated. To test this manually, press &lt;alt&gt;+a, &lt;alt&gt;+b and &lt;alt&gt;+c keys in this order (on Mac OS X, press &lt;Ctrl&gt;+&lt;Opt&gt; instead of &lt;alt&gt;).');
+
+window.jsTestIsAsync = true;
+
+function pressKey(key)
+{
+    if (navigator.userAgent.search(/\bMac OS X\b/) !== -1)
+        modifiers = ["ctrlKey", "altKey"];
+    else
+        modifiers = ["altKey"];
+
+    if (window.eventSender)
+        eventSender.keyDown(key, modifiers);
+}
+
+document.addEventListener("DOMContentLoaded", function () {
+    var input = document.createElement('input');
+    input.accessKey = 'a';
+    input._onfocus_ = function () {
+        testPassed('Pressing the "a" access key triggered a focus event.');
+        input.blur();
+        input.accessKey = 'b';
+        input._onfocus_ = function () {
+            testPassed('Pressing the "b" access key triggered a focus event.');
+            input.blur();
+            input.setAttribute('accesskey', 'c');
+            input._onfocus_ = function () {
+                testPassed('Pressing the "c" access key triggered a focus event.');
+                document.body.removeChild(input);
+                finishJSTest();
+            };
+            pressKey('c');
+        };
+        pressKey('b');
+    };
+    document.body.appendChild(input);
+    pressKey('a');
+});
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (189439 => 189440)


--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2015-09-05 19:45:58 UTC (rev 189439)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2015-09-05 20:54:31 UTC (rev 189440)
@@ -2412,6 +2412,8 @@
 fast/forms/file/input-file-re-render.html
 fast/forms/file/recover-file-input-in-unposted-form.html
 fast/forms/file/selected-files-from-history-state.html
+fast/forms/access-key-case-insensitive.html
+fast/forms/access-key-mutated.html
 fast/forms/interactive-validation-attach-assertion.html
 fast/forms/search-event-delay.html
 fast/forms/select/listbox-oninput-fired.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to