-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability for the IPCTestingAPI to report when a sync message f…
…ails to be received correctly https://bugs.webkit.org/show_bug.cgi?id=264506 rdar://118188347 Reviewed by Alex Christensen. Add the ability for the IPCTestingAPI to report when a sync message fails to be received correctly. The existing behaviour is that both failed messages and empty replies return an empty IPC object. This change records the decoder validity on failure into the MessageSyncReply so the IPCTestingAPI can raise an exception instead. * Source/WebKit/Platform/IPC/Connection.cpp: (IPC::Connection::dispatchSyncMessage): * Source/WebKit/Platform/IPC/Decoder.cpp: (IPC::Decoder::hasMessageTestingError const): * Source/WebKit/Platform/IPC/Decoder.h: * Source/WebKit/Platform/IPC/Encoder.cpp: (IPC::Encoder::setMessageTestingError): * Source/WebKit/Platform/IPC/Encoder.h: * Source/WebKit/Platform/IPC/MessageFlags.h: * Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp: (WebKit::IPCTestingAPI::jsResultFromReplyDecoder): Canonical link: https://commits.webkit.org/270705@main
- Loading branch information
1 parent
38f33ee
commit e36c143
Showing
12 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
LayoutTests/ipc/send-invalid-sync-message-empty-reply-check-exception-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS Sending sync message with incorrect parameters must throw error | ||
|
19 changes: 19 additions & 0 deletions
19
LayoutTests/ipc/send-invalid-sync-message-empty-reply-check-exception.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!doctype html><!-- webkit-test-runner [ IPCTestingAPIEnabled=true ] --> | ||
<title>Test that sending invalid sync messages via the IPC testing API throws the correct errors</title> | ||
<script src="../resources/testharness.js"></script> | ||
<script src="../resources/testharnessreport.js"></script> | ||
<body> | ||
<script> | ||
const defaultTimeout = 1000; | ||
|
||
promise_test(async t => { | ||
if (!window.IPC) | ||
return; | ||
|
||
assert_throws_js(TypeError, | ||
() => { IPC.sendSyncMessage("UI", 0, IPC.messages.IPCTester_SyncPingEmptyReply.name, defaultTimeout, []); }, | ||
`failed sync message must throw error`); | ||
}, "Sending sync message with incorrect parameters must throw error"); | ||
|
||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters