Skip to content

Commit

Permalink
Bug 1864657 [wpt PR 43153] - WebKit export of https://bugs.webkit.org…
Browse files Browse the repository at this point in the history
…/show_bug.cgi?id=260225, a=testonly

Automatic update from web-platform-tests
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=260225 (#43153)

* WebKit export of https://bugs.webkit.org/show_bug.cgi?id=260225
--

wpt-commits: 2ff8cd855638352f565ece0e6ea183772691b497
wpt-pr: 43153

UltraBlame original commit: d79c2dafea368ec09df44d7e85e3a00dc097964e
  • Loading branch information
marco-c committed Nov 30, 2023
1 parent 9a0490e commit 8a40984
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
ctx.fillStyle = "blue";
const drawCanvas = () => {
ctx.fillRect(0, 0, canvas.width, canvas.height);
t.step_timeout(drawCanvas, 50);
};

drawCanvas();

let pc1 = new RTCPeerConnection();
let pc2 = new RTCPeerConnection();

Expand All @@ -32,6 +35,7 @@

const destVideo = document.createElement('video');
destVideo.autoplay = true;
destVideo.muted = true;
const onVideoChange = async () => {
const start = performance.now();
const width = destVideo.videoWidth;
Expand All @@ -41,10 +45,9 @@
if (performance.now() - start > 5000) {
throw new Error("Timeout waiting for video size change");
}
drawCanvas();
await Promise.race([
resizeEvent,
new Promise(r => requestAnimationFrame(r)),
new Promise(r => t.step_timeout(r, 50)),
]);
}
};
Expand All @@ -69,7 +72,7 @@
destVideo.srcObject = new MediaStream([(await haveTrackEvent).track]);

// Wait for video on the other side.
await onVideoChange();
await destVideo.play();
const color = getVideoSignal(destVideo);
assert_not_equals(color, 0);

Expand Down

0 comments on commit 8a40984

Please sign in to comment.