Bug 187288

Summary: [GTK][WPE] Add --host option to WebDriver process
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebDriverAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, bugs-noreply, calvaris, ews-watchlist, webkit-bug-importer, zan
Priority: P2 Keywords: Gtk, InRadar, Soup
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
zan: review+, ews-watchlist: commit-queue-
Archive of layout-test-results from ews205 for win-future none

Description Carlos Garcia Campos 2018-07-03 02:59:51 PDT
We currently allow to pass a port number and the server always listens for connections on localhost. We should allow to optionally pass a host IP address to be able to use WebDriver remotely.
Comment 1 Carlos Garcia Campos 2018-07-03 03:03:36 PDT
Created attachment 344173 [details]
Patch
Comment 2 EWS Watchlist 2018-07-03 04:59:42 PDT
Comment on attachment 344173 [details]
Patch

Attachment 344173 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/8422889

New failing tests:
http/tests/security/canvas-remote-read-remote-video-blocked-no-crossorigin.html
Comment 3 EWS Watchlist 2018-07-03 04:59:54 PDT
Created attachment 344177 [details]
Archive of layout-test-results from ews205 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews205  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 4 Zan Dobersek 2018-07-05 00:58:48 PDT
Comment on attachment 344173 [details]
Patch

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

> Source/WebDriver/HTTPServer.h:60
> +    bool listen(std::optional<String> host, unsigned port);

Nit: it's not that crucial here, but const reference to the std::optional object could be used to avoid copying the object on each call to listen() as well as the soupServerListen() helper.

> Source/WebDriver/soup/HTTPServerSoup.cpp:46
> +        g_set_error(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "Invalid host IP address '%s'", host.value().utf8().data());

Nit: not necessarily an IP address.
Comment 5 Carlos Garcia Campos 2018-07-05 01:10:19 PDT
Comment on attachment 344173 [details]
Patch

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

Thanks!

>> Source/WebDriver/HTTPServer.h:60
>> +    bool listen(std::optional<String> host, unsigned port);
> 
> Nit: it's not that crucial here, but const reference to the std::optional object could be used to avoid copying the object on each call to listen() as well as the soupServerListen() helper.

Ok.

>> Source/WebDriver/soup/HTTPServerSoup.cpp:46
>> +        g_set_error(error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "Invalid host IP address '%s'", host.value().utf8().data());
> 
> Nit: not necessarily an IP address.

It only works with IP addresses, you can't use a domain name.
Comment 6 Carlos Garcia Campos 2018-07-05 05:41:19 PDT
Committed r233516: <https://trac.webkit.org/changeset/233516>
Comment 7 Radar WebKit Bug Importer 2018-07-05 05:43:12 PDT
<rdar://problem/41845014>