⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284774 in webkit


Ignore:
Timestamp:
Oct 25, 2021, 1:58:38 AM (5 years ago)
Author:
ntim@apple.com
Message:

Fix imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html flaky failure on macOS wk1
https://bugs.webkit.org/show_bug.cgi?id=231647

Reviewed by Antti Koivisto.

This only tests a CSS selector feature, use waitUntilStableAutofocusState() helper which is more stable on wk1
to make this test pass.

LayoutTests/imported/w3c:

  • web-platform-tests/css/selectors/focus-visible-009.html:

LayoutTests:

  • platform/mac-wk1/TestExpectations:
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r284773 r284774  
     12021-10-25  Tim Nguyen  <ntim@apple.com>
     2
     3        Fix imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html flaky failure on macOS wk1
     4        https://bugs.webkit.org/show_bug.cgi?id=231647
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This only tests a CSS selector feature, use `waitUntilStableAutofocusState()` helper which is more stable on wk1
     9        to make this test pass.
     10
     11        * platform/mac-wk1/TestExpectations:
     12
    1132021-10-25  Ziran Sun  <zsun@igalia.com>
    214
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r284761 r284774  
     12021-10-25  Tim Nguyen  <ntim@apple.com>
     2
     3        Fix imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html flaky failure on macOS wk1
     4        https://bugs.webkit.org/show_bug.cgi?id=231647
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This only tests a CSS selector feature, use `waitUntilStableAutofocusState()` helper which is more stable on wk1
     9        to make this test pass.
     10
     11        * web-platform-tests/css/selectors/focus-visible-009.html:
     12
    1132021-10-24  Alexey Shvayka  <shvaikalesh@gmail.com>
    214
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html

    r276127 r284774  
    88  <script src="/resources/testharness.js"></script>
    99  <script src="/resources/testharnessreport.js"></script>
     10  <script src="/html/interaction/focus/the-autofocus-attribute/resources/utils.js"></script>
    1011  <style>
    1112    @supports not selector(:focus-visible) {
     
    3435  <button id="button" autofocus tabindex="-1">I will be focused automatically.</button>
    3536  <script>
    36     async_test(function(t) {
    37       button.addEventListener("focus", t.step_func(function() {
    38         assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${button.tagName}#${button.id} should be green`);
    39         assert_not_equals(getComputedStyle(button).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${button.tagName}#${button.id} should NOT be red`);
    40         t.done();
    41       }));
    42 
    43       // Handle the case where the button is focused before the test runs.
    44      if (document.activeElement === button) {
    45         assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${button.tagName}#${button.id} should be green`);
    46         assert_not_equals(getComputedStyle(button).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${button.tagName}#${button.id} should NOT be red`);
    47         t.done();
    48      }
    49 
     37    promise_test(async function() {
     38      await waitUntilStableAutofocusState();
     39      assert_equals(document.activeElement, button, "Should have correct focused element");
     40      assert_equals(getComputedStyle(button).outlineColor, "rgb(0, 128, 0)", `outlineColor for ${button.tagName}#${button.id} should be green`);
     41      assert_not_equals(getComputedStyle(button).backgroundColor, "rgb(255, 0, 0)", `backgroundColor for ${button.tagName}#${button.id} should NOT be red`);
    5042    }, "Autofocus should match :focus-visible");
    5143  </script>
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r284727 r284774  
    691691webkit.org/b/172807 imported/w3c/web-platform-tests/css/selectors/focus-within-display-none-001.html [ Pass Failure ]
    692692
    693 webkit.org/b/231647 imported/w3c/web-platform-tests/css/selectors/focus-visible-009.html [ Pass Failure ]
    694 
    695693webkit.org/b/168409 media/modern-media-controls/airplay-button/airplay-button.html [ Pass Timeout ]
    696694webkit.org/b/168265 media/modern-media-controls/forward-button/forward-button.html [ Pass Timeout ]
Note: See TracChangeset for help on using the changeset viewer.