haikuwebkit/LayoutTests/webrtc/peerconnection-page-cache-l...

64 lines
2.0 KiB
HTML
Raw Permalink Normal View History

Reenable GPUProcess Media flag in WebRTC tests https://bugs.webkit.org/show_bug.cgi?id=221911 Reviewed by Eric Carlson. * platform/mac-wk2/TestExpectations: * platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html: * webrtc/captureCanvas-webrtc-software-h264-baseline.html: * webrtc/captureCanvas-webrtc-software-h264-high.html: * webrtc/captureCanvas-webrtc.html: * webrtc/concurrentVideoPlayback2.html: * webrtc/direction-change.html: * webrtc/disable-encryption.html: * webrtc/h264-baseline.html: * webrtc/h264-high.html: * webrtc/multi-audio.html: * webrtc/multi-video.html: * webrtc/peer-connection-track-end.html: * webrtc/peerconnection-page-cache-long.html: * webrtc/peerconnection-page-cache.html: * webrtc/remove-track.html: * webrtc/utf8-sdp.html: * webrtc/video-addTrack.html: * webrtc/video-addTransceiver.html: * webrtc/video-autoplay.html: * webrtc/video-disabled-black.html: * webrtc/video-h264.html: * webrtc/video-interruption.html: * webrtc/video-mediastreamtrack-stats.html: * webrtc/video-mute.html: * webrtc/video-remote-mute.html: * webrtc/video-replace-muted-track.html: * webrtc/video-replace-track-to-null.html: * webrtc/video-replace-track.html: * webrtc/video-rotation-no-cvo.html: * webrtc/video-rotation.html: * webrtc/video-setDirection.html: * webrtc/video-sframe.html: * webrtc/video-stats.html: * webrtc/video-unmute.html: * webrtc/video-with-data-channel.html: * webrtc/video.html: Canonical link: https://commits.webkit.org/234145@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-16 18:04:28 +00:00
<!-- webkit-test-runner [ UsesBackForwardCache=true ] -->
<!DOCTYPE html>
<html>
<body>
<video id="video" autoplay=""></video>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="routines.js"></script>
<script>
t = async_test();
window.addEventListener("pageshow", async function(event) {
if (!event.persisted)
return;
assert_equals(t.pc1.connectionState, "disconnected");
t.pc1.onconnectionstatechange = () => {
if (t.pc1.connectionState === "connected")
t.done();
}
t.pc1.onicecandidate = (e) => t.pc2.addIceCandidate(e.candidate);
t.pc2.onicecandidate = (e) => t.pc1.addIceCandidate(e.candidate);
const offer = await t.pc1.createOffer();
await t.pc1.setLocalDescription(offer);
await t.pc2.setRemoteDescription(offer);
const answer = await t.pc2.createAnswer();
await t.pc2.setLocalDescription(answer);
await t.pc1.setRemoteDescription(answer);
});
window.addEventListener("pagehide", t.step_func((event) => {
assert_equals(t.pc1.connectionState, "connected");
if (!event.persisted)
assert_uneached("Page failed to enter page cache");
}));
onload = () => {
setTimeout(async () => {
const localStream = await navigator.mediaDevices.getUserMedia({ video: true });
const stream = await new Promise((resolve, reject) => {
createConnections((firstConnection) => {
t.pc1 = firstConnection;
firstConnection.addTrack(localStream.getVideoTracks()[0], localStream);
}, (secondConnection) => {
t.pc2 = secondConnection;
secondConnection.ontrack = (trackEvent) => {
resolve(trackEvent.streams[0]);
};
});
setTimeout(() => reject("Test timed out"), 5000);
});
video.srcObject = stream;
await video.play();
window.location = "../fast/history/resources/page-cache-helper-10000ms.html";
}, 0);
};
</script>
</html>