<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>259104</bug_id>
          
          <creation_ts>2023-07-11 02:35:07 -0700</creation_ts>
          <short_desc>[WPE] gamepad/gamepad-visibility-1.html is failing</short_desc>
          <delta_ts>2025-09-05 07:55:41 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=267523</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Diego Pino">dpino</reporter>
          <assigned_to name="Diego Pino">dpino</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1966160</commentid>
    <comment_count>0</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2023-07-11 02:35:07 -0700</bug_when>
    <thetext>The test fails with the following output:

```
https://build.webkit.org/results/WPE-Linux-64-bit-Release-Tests/265940%40main%20%2811048%29/gamepad/gamepad-visibility-1-diff.txt

--- /home/buildbot/worker/WPE-Linux-64-bit-Release-Tests/build/layout-test-results/gamepad/gamepad-visibility-1-expected.txt
+++ /home/buildbot/worker/WPE-Linux-64-bit-Release-Tests/build/layout-test-results/gamepad/gamepad-visibility-1-actual.txt
@@ -1,2 +1,2 @@
-No connect event seen in 20 run loop spins. Yay.
+Connect event seen! Should NOT have been seen

```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966162</commentid>
    <comment_count>1</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2023-07-11 02:45:53 -0700</bug_when>
    <thetext>Pull request: https://github.com/webkit/webkit/pull/15736</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966333</commentid>
    <comment_count>2</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-07-11 20:31:40 -0700</bug_when>
    <thetext>Committed 265981@main (7e6a722f6ccc): &lt;https://commits.webkit.org/265981@main&gt;

Reviewed commits have been landed. Closing PR #15736 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966334</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-07-11 20:32:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/112117342&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967434</commentid>
    <comment_count>4</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2023-07-19 23:51:42 -0700</bug_when>
    <thetext>The proposed fix made other tests fail (timeout):

```
gamepad/gamepad-polling-access.html
gamepad/gamepad-timestamp.html
gamepad/gamepad-vibration-document-no-longer-fully-active.html
gamepad/gamepad-vibration-visibility-change.html
gamepad/gamepad-vibrationActuator-SameObject.html
gamepad/gamepad-vibrationActuator-nullable.html
gamepad/gamepad-vibrationActuator-playEffect-validation.html
gamepad/gamepad-vibrationActuator-type.html
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2140143</commentid>
    <comment_count>5</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2025-09-01 20:12:51 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/50163</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2140148</commentid>
    <comment_count>6</comment_count>
    <who name="Diego Pino">dpino</who>
    <bug_when>2025-09-01 20:29:46 -0700</bug_when>
    <thetext>This test was failing in all platforms:

https://results.webkit.org/?suite=layout-tests&amp;test=gamepad%2Fgamepad-visibility-1.html&amp;platform=GTK&amp;platform=WPE&amp;platform=mac

Only WebKitGTK, WPEWebKit and Mac were running this test. All other platforms are skipping it. Mac marks the test as flaky, but results.webkit.org shows the test has been constantly failing.

What the test intents to do is to connect a gamepad and change its axis values to verify none of these events emit a &apos;gamepadconnect&apos; event. However, the method &apos;connectMockGamepad&apos; always emits a &apos;gamepadconnect&apos; event, which makes the test fails.

What I think the test tries to validate is this paragraph from the Gamepad spec:

&quot;A user agent MUST dispatch this event type to indicate the user has connected a gamepad. If a gamepad was already connected when the page was loaded, the gamepadconnected event SHOULD be dispatched when the user presses a button or moves an axis.&quot;

https://www.w3.org/TR/gamepad/#event-gamepadconnected

Right now, the class &apos;MockGamepad&apos; doesn&apos;t feature a way of reflecting the scenario described in the spec, which is &quot;a gamepad was already connected&quot;. For this reason, I added an extra argument &apos;wasConnected&apos; to the &apos;setMockGamepadDetails&apos;, so when the pad executes &apos;connectMockGamepad&apos; doesn&apos;t emit a &apos;gamepadconnect&apos; event in case &apos;wasConnected&apos; was true.

Still, I think the logic of the test is wrong, because it verifies that changing the axis of a gamepad already connected doesn&apos;t emit a &apos;gamepadconnect&apos; event, but the spec says it SHOULD. For the moment, I prefer to focus on fixing this test as it is and later change its behaviour to comply with the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2141191</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-09-05 07:55:38 -0700</bug_when>
    <thetext>Committed 299621@main (2a2bdc0d50da): &lt;https://commits.webkit.org/299621@main&gt;

Reviewed commits have been landed. Closing PR #50163 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>