Commit 296f6fba authored by Ionel Popescu's avatar Ionel Popescu Committed by Commit Bot

Expand the select popup for up/down arrows on Mac.

Prior to FormControlsRefresh, expanding the select popup for up/down
arrows was controlled via LayoutThemeMac::PopsMenuByArrowKeys.

Since for FormControlsRefresh, LayoutThemeMacRefresh that inherits from
LayoutThemeDefault is used instead, the PopsMenuByArrowKeys is also
added there as we want to keep the same behavior for up/down arrows.

Bug: 1064455
Change-Id: I3e6006d84549ff1421e9f3aeae381241dc81468d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2148156Reviewed-by: default avatarMason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarDan Clark <daniec@microsoft.com>
Commit-Queue: Ionel Popescu <iopopesc@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#758884}
parent c12ab4bb
......@@ -161,6 +161,7 @@ class LayoutThemeMacRefresh final : public LayoutThemeDefault {
return [[NSFileManager defaultManager] displayNameAtPath:file.GetPath()];
return file.name();
}
bool PopsMenuByArrowKeys() const override;
protected:
// Controls color values returned from FocusRingColor().
......@@ -377,6 +378,10 @@ bool LayoutThemeMacRefresh::UsesTestModeFocusRingColor() const {
return WebTestSupport::IsRunningWebTest();
}
bool LayoutThemeMacRefresh::PopsMenuByArrowKeys() const {
return true;
}
static FontSelectionValue ToFontWeight(NSInteger app_kit_font_weight) {
DCHECK_GT(app_kit_font_weight, 0);
DCHECK_LT(app_kit_font_weight, 15);
......
Verify type ahead selection fires onchange event.
Set focus to select element
Type down arrow twice and type "a"
You see "apple" in select element and "PASS" below select element.
apple
banana
cherry
FAIL
Test clicking with optgroup element
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Click enabled option
PASS $("listbox").selectedIndex is 1
Click on optgroup, should not deselect selectedIndex
PASS $("listbox").selectedIndex is 1
Click disabled option - doesn't change selectedIndex
PASS $("listbox").selectedIndex is 1
Menu list with arrow key. The test is expected to fail on OSX because of a key binding difference.
FAIL $("menulist").selectedIndex should be 8. Was 3.
PASS successfullyParsed is true
TEST COMPLETE
One
Two
Three
Four
One
Two
Three
Four
One
Two
Three
Four
One
Two
Three
Four
One
Two
Three
Four
This test verifies that the Home/End/PageUp/PageDown keys work correctly for pop-up <select> elements that have focus but are not currently popped-up.
Output below is a series of PASS or FAIL lines showing expected and actual selection indexes, followed by a single PASS or FAIL for the status of the entire test.
NOTE: This test will fail on Mac OS, on which these keys are NOT supposed to change the selection of a focused pop-up.
0
1
2
3
4
5
6
0
1
2
3
4
5
6
7
FAIL: selectedIndex should be 3 (is 0) after a PageDown from index 0
FAIL: selectedIndex should be 4 (is 1) after a PageDown from index 1
FAIL: selectedIndex should be 5 (is 2) after a PageDown from index 2
FAIL: selectedIndex should be 6 (is 3) after a PageDown from index 3
FAIL: selectedIndex should be 6 (is 4) after a PageDown from index 4
FAIL: selectedIndex should be 6 (is 5) after a PageDown from index 5
FAIL: selectedIndex should be 3 (is 6) after a PageUp from index 6
FAIL: selectedIndex should be 2 (is 5) after a PageUp from index 5
FAIL: selectedIndex should be 1 (is 4) after a PageUp from index 4
FAIL: selectedIndex should be 0 (is 3) after a PageUp from index 3
FAIL: selectedIndex should be 0 (is 2) after a PageUp from index 2
FAIL: selectedIndex should be 0 (is 1) after a PageUp from index 1
FAIL: selectedIndex should be 0 (is 6) after a Home from index 6
FAIL: selectedIndex should be 0 (is 5) after a Home from index 5
FAIL: selectedIndex should be 0 (is 4) after a Home from index 4
FAIL: selectedIndex should be 0 (is 3) after a Home from index 3
FAIL: selectedIndex should be 0 (is 2) after a Home from index 2
FAIL: selectedIndex should be 0 (is 1) after a Home from index 1
FAIL: selectedIndex should be 6 (is 5) after a End from index 5
FAIL: selectedIndex should be 6 (is 4) after a End from index 4
FAIL: selectedIndex should be 6 (is 3) after a End from index 3
FAIL: selectedIndex should be 6 (is 2) after a End from index 2
FAIL: selectedIndex should be 6 (is 1) after a End from index 1
FAIL: selectedIndex should be 6 (is 0) after a End from index 0
FAIL: selectedIndex should be 4 (is 1) after a PageDown from index 1
FAIL: selectedIndex should be 5 (is 2) after a PageDown from index 2
FAIL: selectedIndex should be 6 (is 4) after a PageDown from index 4
FAIL: selectedIndex should be 6 (is 5) after a PageDown from index 5
FAIL: selectedIndex should be 2 (is 6) after a PageUp from index 6
FAIL: selectedIndex should be 2 (is 5) after a PageUp from index 5
FAIL: selectedIndex should be 1 (is 4) after a PageUp from index 4
FAIL: selectedIndex should be 1 (is 2) after a PageUp from index 2
FAIL: selectedIndex should be 1 (is 7) after a Home from index 7
FAIL: selectedIndex should be 1 (is 6) after a Home from index 6
FAIL: selectedIndex should be 1 (is 5) after a Home from index 5
FAIL: selectedIndex should be 1 (is 4) after a Home from index 4
FAIL: selectedIndex should be 1 (is 3) after a Home from index 3
FAIL: selectedIndex should be 1 (is 2) after a Home from index 2
FAIL: selectedIndex should be 1 (is 0) after a Home from index 0
FAIL: selectedIndex should be 6 (is 7) after a End from index 7
FAIL: selectedIndex should be 6 (is 5) after a End from index 5
FAIL: selectedIndex should be 6 (is 4) after a End from index 4
FAIL: selectedIndex should be 6 (is 3) after a End from index 3
FAIL: selectedIndex should be 6 (is 2) after a End from index 2
FAIL: selectedIndex should be 6 (is 1) after a End from index 1
FAIL: selectedIndex should be 6 (is 0) after a End from index 0
FAIL: SOME TESTS FAILED (SEE ABOVE)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment