haikuwebkit/LayoutTests/webrtc/datachannel/gather-candidates-networkpr...

44 lines
1.5 KiB
HTML
Raw Permalink Normal View History

Protect WebRTC network monitoring to wait forever in edge cases https://bugs.webkit.org/show_bug.cgi?id=204846 Source/WebKit: Reviewed by Eric Carlson. We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client. The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging waiting for the completion of network list. We are now sending an IPC message for every client and the network process will ignore the ones that are not useful. In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang. They might still fail connecting, which is ok since network process crashed. Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): * NetworkProcess/webrtc/NetworkRTCMonitor.h: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: (WebKit::LibWebRTCNetwork::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): (WebKit::WebRTCMonitor::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): LayoutTests: <rdar://problem/57618773> Reviewed by Eric Carlson. * webrtc/datachannel/gather-candidates-networkprocess-crash-expected.txt: Added. * webrtc/datachannel/gather-candidates-networkprocess-crash.html: Added. Canonical link: https://commits.webkit.org/218152@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-06 09:25:22 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing ICE candidate filtering when using data channel</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<script>
promise_test(async (test) => {
let pc = new RTCPeerConnection();
Protect WebRTC network monitoring to wait forever in edge cases https://bugs.webkit.org/show_bug.cgi?id=204846 Source/WebKit: Reviewed by Eric Carlson. We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client. The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging waiting for the completion of network list. We are now sending an IPC message for every client and the network process will ignore the ones that are not useful. In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang. They might still fail connecting, which is ok since network process crashed. Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): * NetworkProcess/webrtc/NetworkRTCMonitor.h: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: (WebKit::LibWebRTCNetwork::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): (WebKit::WebRTCMonitor::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): LayoutTests: <rdar://problem/57618773> Reviewed by Eric Carlson. * webrtc/datachannel/gather-candidates-networkprocess-crash-expected.txt: Added. * webrtc/datachannel/gather-candidates-networkprocess-crash.html: Added. Canonical link: https://commits.webkit.org/218152@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-06 09:25:22 +00:00
pc.createDataChannel('sendDataChannel');
let offer = await pc.createOffer();
Protect WebRTC network monitoring to wait forever in edge cases https://bugs.webkit.org/show_bug.cgi?id=204846 Source/WebKit: Reviewed by Eric Carlson. We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client. The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging waiting for the completion of network list. We are now sending an IPC message for every client and the network process will ignore the ones that are not useful. In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang. They might still fail connecting, which is ok since network process crashed. Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): * NetworkProcess/webrtc/NetworkRTCMonitor.h: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: (WebKit::LibWebRTCNetwork::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): (WebKit::WebRTCMonitor::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): LayoutTests: <rdar://problem/57618773> Reviewed by Eric Carlson. * webrtc/datachannel/gather-candidates-networkprocess-crash-expected.txt: Added. * webrtc/datachannel/gather-candidates-networkprocess-crash.html: Added. Canonical link: https://commits.webkit.org/218152@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-06 09:25:22 +00:00
pc.setLocalDescription(offer);
// This test is a bit racy, we are trying to have network process crash between the time it receives a monitor start request and the time it answers that request.
if (window.testRunner && testRunner.terminateNetworkProcess) {
Protect WebRTC network monitoring to wait forever in edge cases https://bugs.webkit.org/show_bug.cgi?id=204846 Source/WebKit: Reviewed by Eric Carlson. We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client. The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging waiting for the completion of network list. We are now sending an IPC message for every client and the network process will ignore the ones that are not useful. In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang. They might still fail connecting, which is ok since network process crashed. Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): * NetworkProcess/webrtc/NetworkRTCMonitor.h: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: (WebKit::LibWebRTCNetwork::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): (WebKit::WebRTCMonitor::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): LayoutTests: <rdar://problem/57618773> Reviewed by Eric Carlson. * webrtc/datachannel/gather-candidates-networkprocess-crash-expected.txt: Added. * webrtc/datachannel/gather-candidates-networkprocess-crash.html: Added. Canonical link: https://commits.webkit.org/218152@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-06 09:25:22 +00:00
setTimeout(() => testRunner.terminateNetworkProcess(), 0);
await new Promise(resolve => setTimeout(resolve, 50));
let hasResponse = false;
while (!hasResponse) {
const response = await fetch(".").then(r => r, () => { return { status : -1 } });
hasResponse = response.status !== -1;
}
}
let pc2 = new RTCPeerConnection();
pc2.createDataChannel('sendDataChannel');
const iceCandidatePromise = new Promise((resolve, reject) => {
pc2.onicecandidate = resolve;
setTimeout(() => reject('ice candidate event time out'), 10000);
});
offer = await pc2.createOffer();
pc2.setLocalDescription(offer);
return iceCandidatePromise;
Protect WebRTC network monitoring to wait forever in edge cases https://bugs.webkit.org/show_bug.cgi?id=204846 Source/WebKit: Reviewed by Eric Carlson. We were limiting the number of IPC message sent to network process by only sending the start monitoring event for the first client. The issue is that, if network process crashes for instance while having not yet given the list of networks, all clients will be hanging waiting for the completion of network list. We are now sending an IPC message for every client and the network process will ignore the ones that are not useful. In addition, in case of network process crash, we send a signal that network list has changed to make sure clients will never hang. They might still fail connecting, which is ok since network process crashed. Test: webrtc/datachannel/gather-candidates-networkprocess-crash.html * NetworkProcess/webrtc/NetworkRTCMonitor.cpp: (WebKit::NetworkRTCMonitor::startUpdatingIfNeeded): * NetworkProcess/webrtc/NetworkRTCMonitor.h: * NetworkProcess/webrtc/NetworkRTCMonitor.messages.in: * WebProcess/Network/webrtc/LibWebRTCNetwork.h: (WebKit::LibWebRTCNetwork::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.cpp: (WebKit::WebRTCMonitor::StartUpdating): (WebKit::WebRTCMonitor::StopUpdating): (WebKit::WebRTCMonitor::networksChanged): (WebKit::WebRTCMonitor::networkProcessCrashed): * WebProcess/Network/webrtc/WebRTCMonitor.h: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::networkProcessConnectionClosed): LayoutTests: <rdar://problem/57618773> Reviewed by Eric Carlson. * webrtc/datachannel/gather-candidates-networkprocess-crash-expected.txt: Added. * webrtc/datachannel/gather-candidates-networkprocess-crash.html: Added. Canonical link: https://commits.webkit.org/218152@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-06 09:25:22 +00:00
}, "Gathering ICE candidates from a data channel while network process is crashing");
</script>
</body>
</html>