From ba45f907a74dd8f03acb579e5eb0f3f7b9b8fc43 Mon Sep 17 00:00:00 2001 From: Youenn Fablet Date: Mon, 29 Jan 2024 10:21:06 +0100 Subject: [PATCH] Move tests using legacy MediaStreamTrackGenerator to a legacy folder --- .../MediaStreamTrackGenerator-audio.https.html | 0 ...mTrackGenerator-in-service-worker.https.html | 0 ...amTrackGenerator-in-shared-worker.https.html | 0 ...diaStreamTrackGenerator-in-worker.https.html | 0 ...ackGenerator-pipes-data-in-worker.https.html | 0 .../MediaStreamTrackGenerator-video.https.html | 0 ...StreamTrackProcessor-backpressure.https.html | 0 .../MediaStreamTrackProcessor-video.https.html | 0 .../legacy/MediaStreamTrackProcessor-worker.js | 17 +++++++++++++++++ .../{tentative => legacy}/dedicated-worker.js | 0 .../{tentative => legacy}/service-worker.js | 0 .../{tentative => legacy}/shared-worker.js | 0 12 files changed, 17 insertions(+) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackGenerator-audio.https.html (100%) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackGenerator-in-service-worker.https.html (100%) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackGenerator-in-shared-worker.https.html (100%) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackGenerator-in-worker.https.html (100%) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackGenerator-pipes-data-in-worker.https.html (100%) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackGenerator-video.https.html (100%) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackProcessor-backpressure.https.html (100%) rename mediacapture-insertable-streams/{tentative => legacy}/MediaStreamTrackProcessor-video.https.html (100%) create mode 100644 mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-worker.js rename mediacapture-insertable-streams/{tentative => legacy}/dedicated-worker.js (100%) rename mediacapture-insertable-streams/{tentative => legacy}/service-worker.js (100%) rename mediacapture-insertable-streams/{tentative => legacy}/shared-worker.js (100%) diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-audio.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-audio.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-audio.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-audio.https.html diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-in-service-worker.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-in-service-worker.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-in-service-worker.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-in-service-worker.https.html diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-in-shared-worker.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-in-shared-worker.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-in-shared-worker.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-in-shared-worker.https.html diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-in-worker.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-in-worker.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-in-worker.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-in-worker.https.html diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-pipes-data-in-worker.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-pipes-data-in-worker.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-pipes-data-in-worker.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-pipes-data-in-worker.https.html diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-video.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-video.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackGenerator-video.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackGenerator-video.https.html diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackProcessor-backpressure.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-backpressure.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackProcessor-backpressure.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-backpressure.https.html diff --git a/mediacapture-insertable-streams/tentative/MediaStreamTrackProcessor-video.https.html b/mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-video.https.html similarity index 100% rename from mediacapture-insertable-streams/tentative/MediaStreamTrackProcessor-video.https.html rename to mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-video.https.html diff --git a/mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-worker.js b/mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-worker.js new file mode 100644 index 00000000000000..51eaef80a90a6e --- /dev/null +++ b/mediacapture-insertable-streams/legacy/MediaStreamTrackProcessor-worker.js @@ -0,0 +1,17 @@ +onmessage = async msg => { + const reader = msg.data.readable.getReader(); + let readResult = await reader.read(); + postMessage(readResult.value); + readResult.value.close(); + // Continue reading until the stream is done due to a track.stop() + while (true) { + readResult = await reader.read(); + if (readResult.done) { + break; + } else { + readResult.value.close(); + } + } + await reader.closed; + postMessage('closed'); +} diff --git a/mediacapture-insertable-streams/tentative/dedicated-worker.js b/mediacapture-insertable-streams/legacy/dedicated-worker.js similarity index 100% rename from mediacapture-insertable-streams/tentative/dedicated-worker.js rename to mediacapture-insertable-streams/legacy/dedicated-worker.js diff --git a/mediacapture-insertable-streams/tentative/service-worker.js b/mediacapture-insertable-streams/legacy/service-worker.js similarity index 100% rename from mediacapture-insertable-streams/tentative/service-worker.js rename to mediacapture-insertable-streams/legacy/service-worker.js diff --git a/mediacapture-insertable-streams/tentative/shared-worker.js b/mediacapture-insertable-streams/legacy/shared-worker.js similarity index 100% rename from mediacapture-insertable-streams/tentative/shared-worker.js rename to mediacapture-insertable-streams/legacy/shared-worker.js