Bug 158257 - [GTK] Media and audio permission request unit tests are timing out
Summary: [GTK] Media and audio permission request unit tests are timing out
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Philippe Normand
URL:
Keywords: Gtk, InRadar
Depends on:
Blocks:
 
Reported: 2016-06-01 02:51 PDT by Carlos Garcia Campos
Modified: 2020-05-11 02:49 PDT (History)
10 users (show)

See Also:


Attachments
Patch (8.31 KB, patch)
2020-05-07 08:43 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (9.84 KB, patch)
2020-05-08 01:36 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (10.28 KB, patch)
2020-05-08 06:39 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff
Patch (9.83 KB, patch)
2020-05-11 01:19 PDT, Philippe Normand
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2016-06-01 02:51:25 PDT
/webkit2/WebKitWebView/usermedia-permission-requests:                
** (WebKitWebProcess:35051): WARNING **: PulseAudio: error: Connection refused

** (WebKitWebProcess:35051): WARNING **: PulseAudio: failed to connect to daemon
TEST: WebKitBuild/Debug/bin/TestWebKitAPI/WebKit2Gtk/TestUIClient: TIMEOUT


  /webkit2/WebKitWebView/audio-usermedia-permission-request:           
** (WebKitWebProcess:35379): WARNING **: PulseAudio: error: Connection refused

** (WebKitWebProcess:35379): WARNING **: PulseAudio: failed to connect to daemon
TEST: WebKitBuild/Debug/bin/TestWebKitAPI/WebKit2Gtk/TestUIClient: TIMEOUT

I don't know if this is something specific to the bots, or that the API is just broken, I never build with that enabled.
Comment 1 Philippe Normand 2016-06-01 02:54:57 PDT
Looks like a bot issue.
Comment 2 Michael Catanzaro 2018-11-02 17:46:21 PDT
/webkit/WebKitWebView/usermedia-enumeratedevices-permission-check is similarly broken. (I wonder if it ever passed on the bots?) I'm marking it against this bug.
Comment 3 Philippe Normand 2020-05-07 06:28:22 PDT
I can't reproduce this. Let's try to unskip and see the the gtk-api EWS likes it or not...
Comment 4 Philippe Normand 2020-05-07 06:31:54 PDT
Oh actually, I can reproduce this!!! Let's debug the fun...
Comment 5 Philippe Normand 2020-05-07 08:43:44 PDT
Created attachment 398738 [details]
Patch
Comment 6 EWS Watchlist 2020-05-07 08:44:28 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 7 Philippe Normand 2020-05-07 08:44:59 PDT
Comment on attachment 398738 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398738&action=review

> Source/WebKit/ChangeLog:10
> +        (webkit_settings_set_enable_mock_capture_devices): Hack: relax
> +        secure connection requirement when enabling Mock sources.

Carlos, I haven't found a better way to handle this. In the mac port this is exposed as a private setting. Do we have a similar thing?
Comment 8 Carlos Garcia Campos 2020-05-08 01:05:21 PDT
Comment on attachment 398738 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398738&action=review

>> Source/WebKit/ChangeLog:10
>> +        secure connection requirement when enabling Mock sources.
> 
> Carlos, I haven't found a better way to handle this. In the mac port this is exposed as a private setting. Do we have a similar thing?

We don't have private settings, but we can add private API to enable/disable an internal setting.

> Tools/ChangeLog:8
> +        Fix getUserMedia glib tests. They require mock media capture devices.

So, do the tests really need to enable mock devices? or what they really need is enable secure connection and we use that setting to get it?
Comment 9 Philippe Normand 2020-05-08 01:36:28 PDT
Created attachment 398841 [details]
Patch
Comment 10 Philippe Normand 2020-05-08 02:30:29 PDT
Comment on attachment 398738 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398738&action=review

>> Tools/ChangeLog:8
>> +        Fix getUserMedia glib tests. They require mock media capture devices.
> 
> So, do the tests really need to enable mock devices? or what they really need is enable secure connection and we use that setting to get it?

In the latest patch I disabled mock devices because indeed I thought they were not required, but here I do have a webcam, tests pass. On the EWS bot there's no webcam, tests time out. So I'll re-enable mock devices and see if the bot likes this...
Comment 11 Philippe Normand 2020-05-08 06:39:51 PDT
Created attachment 398856 [details]
Patch
Comment 12 Philippe Normand 2020-05-08 07:03:06 PDT
api-gtk is green, woohoo.
Comment 13 Carlos Garcia Campos 2020-05-10 22:02:23 PDT
Comment on attachment 398856 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=398856&action=review

> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:2766
> +void webkitWebViewSetMediaCaptureRequiresSecureConnection(WebKitWebView* webView, bool required)

Why don't you add the private API to WebKitSettings directly?

> Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:2772
> +    page.setPreferences(*preferences);

page is only used here you can getPage(webView).setPreferences(*preferences); But why do you need to set the page preferences again here?
Comment 14 Philippe Normand 2020-05-11 01:19:04 PDT
Created attachment 399002 [details]
Patch
Comment 15 EWS 2020-05-11 02:48:04 PDT
Committed r261473: <https://trac.webkit.org/changeset/261473>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 399002 [details].
Comment 16 Radar WebKit Bug Importer 2020-05-11 02:49:15 PDT
<rdar://problem/63082298>