Bug 216908

Summary: [PlayStation][WinCairo] Enable WebDriver target on PlayStation and client for WinCairo
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: PlatformAssignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, aperez, Basuke.Suzuki, bburg, cgarcia, don.olmstead, ews-watchlist, gyuyoung.kim, hi, joepeck, keith_miller, mark.lam, msaboff, ryuan.choi, saam, sergio, stephan.szabo, tzagallo, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
PATCH
none
PATCH
none
PATCH none

Description Basuke Suzuki 2020-09-23 17:28:07 PDT
Time to make it.
Comment 1 Basuke Suzuki 2020-09-24 15:51:51 PDT
Created attachment 409627 [details]
PATCH
Comment 2 Basuke Suzuki 2020-09-24 15:52:40 PDT
Created attachment 409628 [details]
PATCH
Comment 3 Basuke Suzuki 2020-09-24 15:55:24 PDT
With this patch, followings are activated:
- WinCairo WebDriver client binary which can connect to PlayStation.
- PlayStation WebDriver client binary which can connect to itself.
- PlayStation automation Host backed by RemoteInspector protocol.
Comment 4 Don Olmstead 2020-09-25 10:25:56 PDT
Comment on attachment 409628 [details]
PATCH

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

Just commenting on the build part currently

> Source/WebDriver/HTTPServer.h:39
> +#define USE_NATIVE_HTTPD 1

Don't define this. Just do USE(INSPECTOR_SOCKET_SERVER).

> Source/WebDriver/PlatformPlayStation.cmake:13
> +    ${JavaScriptCore_DERIVED_SOURCES_DIR}

Why is this including the JSC Derived Sources dir?

> Source/WebDriver/PlatformWin.cmake:15
> +    ${JavaScriptCore_DERIVED_SOURCES_DIR}

Ditto

> Source/WebDriver/socket/HTTPParser.cpp:2
> + * Copyright (C) 2019 Sony Interactive Entertainment Inc.

Nit copyright year.

> Source/WebDriver/socket/HTTPParser.h:2
> + * Copyright (C) 2019 Sony Interactive Entertainment Inc.

Nit copyright year
Comment 5 Adrian Perez 2020-09-28 08:49:14 PDT
Comment on attachment 409628 [details]
PATCH

The parts that touch the common code look reasonable to me, but I am
not that well acquainted with the WebDriver and RemoteInspector bits
to dare to rubber-stamp it.

If Carlos García could take a look, that would the best ☝️
Comment 6 Basuke Suzuki 2020-09-28 09:12:32 PDT
Comment on attachment 409628 [details]
PATCH

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

Thanks!

>> Source/WebDriver/HTTPServer.h:39
>> +#define USE_NATIVE_HTTPD 1
> 
> Don't define this. Just do USE(INSPECTOR_SOCKET_SERVER).

Okay, got it.

>> Source/WebDriver/PlatformPlayStation.cmake:13
>> +    ${JavaScriptCore_DERIVED_SOURCES_DIR}
> 
> Why is this including the JSC Derived Sources dir?

Because it uses common code of JSC's socket RemoteInspector implementation.

>> Source/WebDriver/socket/HTTPParser.cpp:2
>> + * Copyright (C) 2019 Sony Interactive Entertainment Inc.
> 
> Nit copyright year.

Yey. We need style checker rule for this :)
Comment 7 Basuke Suzuki 2020-09-28 09:13:29 PDT
(In reply to Adrian Perez from comment #5)
> Comment on attachment 409628 [details]
> PATCH
> 
> The parts that touch the common code look reasonable to me, but I am
> not that well acquainted with the WebDriver and RemoteInspector bits
> to dare to rubber-stamp it.
> 
> If Carlos García could take a look, that would the best ☝️

Thanks, Adrian!
Comment 8 Carlos Garcia Campos 2020-09-29 00:48:28 PDT
Comment on attachment 409628 [details]
PATCH

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

LGTM

> Source/WebDriver/WebDriverService.cpp:51
> +    printf("  -t <ip:port> --target=<ip:port> [WinCairo] Target IP and port\n");

Make this conditional to WinCairo (or INSPECTOR_SOCKET_SERVER)
Comment 9 Stephan Szabo 2020-09-29 12:10:09 PDT
Comment on attachment 409628 [details]
PATCH

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

> Source/WebDriver/socket/SessionHostSocket.cpp:146
> +    m_capabilities.browserVersion = String::fromUTF8("TODO/browserVersion");

Is there a reason to leave the TODO names here (like do they also get set in some other path?)
Comment 10 Basuke Suzuki 2020-09-29 14:20:00 PDT
Comment on attachment 409628 [details]
PATCH

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

>>> Source/WebDriver/PlatformPlayStation.cmake:13
>>> +    ${JavaScriptCore_DERIVED_SOURCES_DIR}
>> 
>> Why is this including the JSC Derived Sources dir?
> 
> Because it uses common code of JSC's socket RemoteInspector implementation.

It is built without this line, so I'll remove it.

>> Source/WebDriver/PlatformWin.cmake:15
>> +    ${JavaScriptCore_DERIVED_SOURCES_DIR}
> 
> Ditto

Dotto

>> Source/WebDriver/WebDriverService.cpp:51
>> +    printf("  -t <ip:port> --target=<ip:port> [WinCairo] Target IP and port\n");
> 
> Make this conditional to WinCairo (or INSPECTOR_SOCKET_SERVER)

Right. Thanks.

>> Source/WebDriver/socket/SessionHostSocket.cpp:146
>> +    m_capabilities.browserVersion = String::fromUTF8("TODO/browserVersion");
> 
> Is there a reason to leave the TODO names here (like do they also get set in some other path?)

Yes, that must be done quickly, but we don't have proper versioning in our port and we also don't have a way to access them from the code. I'll create a ticket for that.
Comment 11 Basuke Suzuki 2020-09-29 21:23:21 PDT
Created attachment 410091 [details]
PATCH
Comment 12 EWS 2020-09-30 14:23:03 PDT
Committed r267807: <https://trac.webkit.org/changeset/267807>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410091 [details].
Comment 13 Radar WebKit Bug Importer 2020-09-30 14:24:16 PDT
<rdar://problem/69808308>