Bug 217565

Summary: IPC testing JS API should expose a reply and describe the list of arguments for each message
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: Tools / TestsAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: annulen, beidson, cdumez, commit-queue, ews-watchlist, ggaren, gyuyoung.kim, Hironori.Fujii, ryuan.choi, sergio, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 217728    
Bug Blocks:    
Attachments:
Description Flags
WIP
ews-feeder: commit-queue-
WIP2
none
Patch
none
Patch none

Description Ryosuke Niwa 2020-10-10 21:28:07 PDT
JS API added in https://trac.webkit.org/r268239 to test IPC should wait & decode the reply and expose it as JS objects.
We should also describe the list of arguments for each IPC message.
Comment 1 Ryosuke Niwa 2020-10-10 21:29:46 PDT
Created attachment 411029 [details]
WIP
Comment 2 Ryosuke Niwa 2020-10-12 00:22:52 PDT
Created attachment 411099 [details]
WIP2
Comment 3 Ryosuke Niwa 2020-10-13 13:09:32 PDT
Created attachment 411242 [details]
Patch
Comment 4 Geoffrey Garen 2020-10-13 13:16:15 PDT
Comment on attachment 411242 [details]
Patch

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

r=me

> Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:151
> +        { "sessionID", sessionID, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
> +        { "pageIdentifier", pageIdentifier, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },

How about naming these sessionID and pageID, to keep our JavaScript code consistent.
Comment 5 Ryosuke Niwa 2020-10-13 13:32:04 PDT
Comment on attachment 411242 [details]
Patch

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

>> Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:151
>> +        { "pageIdentifier", pageIdentifier, 0, kJSPropertyAttributeDontDelete | kJSPropertyAttributeReadOnly },
> 
> How about naming these sessionID and pageID, to keep our JavaScript code consistent.

I guess we'd also rename frameIdentifier to frameID in that case.

> Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:564
> +        returnValue = JSObjectMakeDeferredPromise(context, &resolve, &reject, exception);

Hm... Mojave complains that I'm using this even though I have a local build of WebKit.
Comment 6 Geoffrey Garen 2020-10-13 13:33:32 PDT
EWS is angry:

CompileC /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/Objects-normal/x86_64/UnifiedSource76.o /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/DerivedSources/WebKit2/unified-sources/Unifi
edSource76.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/Source/WebKit
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu++1z -stdlib=libc++ -gmodules -Wno-trigraphs -fno-exceptions -fno-rtti -fno-sanitize=vptr -fpascal-strings -O0 -fno-common -Werror -Wno-missing-field-initializers -Wmissing-prototypes -Wunreachable-code -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wsign-compare -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions -DENABLE_EXPERIMENTAL_FEATURES -DHAVE_CORE_PREDICTION -DFRAMEWORK_NAME=WebKit -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.14 -g -fvisibility=hidden -fvisibility-inlines-hidden -fno-threadsafe-statics -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -iquote /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/WebKit-generated-files.hmap -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/WebKit-own-target-headers.hmap -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/WebKit-all-target-headers.hmap -iquote /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/WebKit-project-headers.hmap -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/include -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/usr/local/include -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/WebCore.framework/PrivateHeaders/ForwardingHeaders -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/DerivedSources/WebKit2 -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/usr/local/include/WebKitAdditions -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include/WebKitAdditions -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/usr/local/include/webrtc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include/webrtc -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/Source/WebKit -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/DerivedSources-normal/x86_64 -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/DerivedSources/x86_64 -I/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/DerivedSources -Wall -Wextra -Wcast-qual -Wchar-subscripts -Wconditional-uninitialized -Wextra-tokens -Wformat-security -Winit-self -Wmissing-format-attribute -Wmissing-noreturn -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wundef -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla -Wliteral-conversion -F/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug -F/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/Source/WebKit/../../WebKitLibraries/WebKitPrivateFrameworkStubs/Mac/10140
0 -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/PrivateFrameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/PrivateFrameworks -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/System.framework/PrivateHeaders -include /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/PrecompiledHeaders/WebKit2Prefix-awuiitavrzgbhueqydpoigkowpiq/WebKit2Prefix.h -MMD -MT dependencies -MF /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/Objects-normal/x86_64/UnifiedSource76.d --serialize-diagnostics /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/Objects-normal/x86_64/UnifiedSource76.dia -c /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/DerivedSources/WebKit2/unified-sources/UnifiedSource76.cpp -o /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/WebKit.build/Debug/WebKit.build/Objects-normal/x86_64/UnifiedSource76.o
In file included from /Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/WebKitBuild/Debug/DerivedSources/WebKit2/unified-sources/UnifiedSource76.cpp:5:
/Volumes/Data/worker/macOS-Mojave-Debug-Build-EWS/build/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:564:23: error: 'JSObjectMakeDeferredPromise' is only available on macOS 10.15 or newer [-Werror,-Wunguarded-availability-new]
Comment 7 Ryosuke Niwa 2020-10-13 13:39:13 PDT
Yeah, how do we suppress that warning in Mojave? It's totally irrelevant that JSC that shipped in Mojave doesn't have that API...
Comment 8 Ryosuke Niwa 2020-10-13 13:41:26 PDT
(In reply to Ryosuke Niwa from comment #7)
> Yeah, how do we suppress that warning in Mojave? It's totally irrelevant
> that JSC that shipped in Mojave doesn't have that API...

Found it: ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
Comment 9 Ryosuke Niwa 2020-10-13 14:00:49 PDT
Created attachment 411251 [details]
Patch
Comment 10 Ryosuke Niwa 2020-10-13 14:17:02 PDT
Comment on attachment 411251 [details]
Patch

This was already reviewed by Geoff. Just waiting for EWS.
Comment 11 Ryosuke Niwa 2020-10-13 16:20:56 PDT
Committed r268431: <https://trac.webkit.org/changeset/268431>
Comment 12 Radar WebKit Bug Importer 2020-10-13 16:21:17 PDT
<rdar://problem/70271211>
Comment 13 Fujii Hironori 2020-10-13 17:17:24 PDT
Filed: Bug 217688 – [WinCaio][PlayStation] reference to undefined symbol `IPC::messageReplyArgumentDescriptions(IPC::MessageName)' since r268431
Comment 14 Ryosuke Niwa 2020-10-13 20:20:45 PDT
Committed r268443: <https://trac.webkit.org/changeset/268443>
Comment 15 WebKit Commit Bot 2020-10-14 13:41:06 PDT
Re-opened since this is blocked by bug 217728
Comment 16 Fujii Hironori 2020-10-14 14:05:02 PDT
*** Bug 217688 has been marked as a duplicate of this bug. ***
Comment 17 Ryosuke Niwa 2020-10-14 17:33:32 PDT
Committed r268503: <https://trac.webkit.org/changeset/268503>
Comment 18 Ryosuke Niwa 2020-10-14 18:44:06 PDT
Build fix: https://trac.webkit.org/r268504