Bug 167272 - Require a button press on a gamepad for them to be exposed to the DOM
Summary: Require a button press on a gamepad for them to be exposed to the DOM
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
Keywords: InRadar
Depends on:
Reported: 2017-01-20 17:40 PST by Brady Eidson
Modified: 2017-01-31 21:38 PST (History)
3 users (show)

See Also:

Patch (33.25 KB, patch)
2017-01-20 17:42 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2017-01-20 17:40:02 PST
Require a button press on a gamepad for them to be exposed to the DOM

Comment 1 Brady Eidson 2017-01-20 17:42:59 PST
Created attachment 299412 [details]
Comment 2 WebKit Commit Bot 2017-01-20 18:25:32 PST
Comment on attachment 299412 [details]

Clearing flags on attachment: 299412

Committed r211007: <http://trac.webkit.org/changeset/211007>
Comment 3 WebKit Commit Bot 2017-01-20 18:25:35 PST
All reviewed patches have been landed.  Closing bug.
Comment 4 Joseph Pecoraro 2017-01-30 23:26:16 PST
Hmm, I'm seeing this test as flakey on a lot of EWS bots this past week:

I'm able to reproduce this locally, when I run the test 10 times it typically fails the first time and passes all the rest:

  $ run-webkit-tests --iterations=10 --exit-after-n-failures=1 gamepad/gamepad-visibility-1.html

When it fails I see:

--- /layout-test-results/gamepad/gamepad-visibility-1-expected.txt
+++ /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

Before marking the test as flakey is there some debugging we can add to the test that would make it easier to investigate?
Comment 5 Joseph Pecoraro 2017-01-30 23:47:32 PST
From the WebContentProcess side I see the dispatch via:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
    frame #0: WebCore`WebCore::GamepadManager::makeGamepadVisible(this=0x000000011910eb08, platformGamepad=0x00007fcfd0e05910, navigatorSet=0x000000011910eb18, domWindowSet=0x000000011910eb68) at GamepadManager.cpp:159
    frame #1: WebCore`WebCore::GamepadManager::platformGamepadConnected(this=0x000000011910eb08, platformGamepad=0x00007fcfd0e05910) at GamepadManager.cpp:76
    frame #2: WebKit`WebKit::WebGamepadProvider::gamepadConnected(this=0x000000010f64eb10, gamepadData=0x00007fff542baea8) at WebGamepadProvider.cpp:84
    frame #3: WebKit`WebKit::WebProcess::gamepadConnected(this=0x00007fcfd1006400, gamepadData=0x00007fff542baea8) at WebProcess.cpp:1026
    frame #4: WebKit`void IPC::callMemberFunctionImpl<WebKit::WebProcess, void (WebKit::WebProcess::*)(WebKit::GamepadData const&), std::__1::tuple<WebKit::GamepadData>, 0ul>(object=0x00007fcfd1006400, function=40 70 ee 0e 01 00 00 00 00 00 00 00 00 00 00 00, args=0x00007fff542baea8, (null)=std::__1::index_sequence<0UL> @ 0x00007fff542badd0)(WebKit::GamepadData const&), std::__1::tuple<WebKit::GamepadData>&&, std::__1::integer_sequence<unsigned long, 0ul>) at HandleMessage.h:40

Is there something that should be preventing the platformGamepadConnected here?
Comment 6 Joseph Pecoraro 2017-01-31 21:38:54 PST
Ryan marked this as flakey (see bug 167517).