From 45a02a76c8aee3c4827c87c067f49af8d79ce90c Mon Sep 17 00:00:00 2001
From: Marco Castelluccio <mcastelluccio@mozilla.com>
Date: Tue, 22 Oct 2024 21:46:43 +0000
Subject: [PATCH] Bug 1924455 [wpt PR 48591] - [wpt] Fail
 `VideoTrackGenerator-with-window-tracks.https.html` faster, a=testonly

Automatic update from web-platform-tests
[wpt] Fail `VideoTrackGenerator-with-window-tracks.https.html` faster

`VideoTrackGenerator` is not exposed to workers, which currently causes
the test to hang. Surface worker errors to the `promise_test()`s
instead.

Drive-by: always revoke the temporary script URL.

Bug: 40058895
Change-Id: Id0e3830abadecac7c76853235a09b201fdad1af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5922435
Auto-Submit: Jonathan Lee <jonathanjleegoogle.com>
Reviewed-by: Harald Alvestrand <htachromium.org>
Commit-Queue: Jonathan Lee <jonathanjleegoogle.com>
Cr-Commit-Position: refs/heads/main{#1368294}

--

wpt-commits: 302e6e04c6c54bf3891e6a6a15a2e04e3f72bb52
wpt-pr: 48591

UltraBlame original commit: 378f7e6ed8f4dcc66625b9b97b785562ec614a6a
---
 ...ackGenerator-with-window-tracks.https.html | 29 +++++++++++++++----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/testing/web-platform/tests/mediacapture-insertable-streams/VideoTrackGenerator-with-window-tracks.https.html b/testing/web-platform/tests/mediacapture-insertable-streams/VideoTrackGenerator-with-window-tracks.https.html
index 4fe8c20c460c..da5eec21e991 100644
--- a/testing/web-platform/tests/mediacapture-insertable-streams/VideoTrackGenerator-with-window-tracks.https.html
+++ b/testing/web-platform/tests/mediacapture-insertable-streams/VideoTrackGenerator-with-window-tracks.https.html
@@ -573,29 +573,50 @@
 url
 )
 ;
+try
+{
 await
 new
 Promise
 (
+(
 resolve
+reject
+)
 =
 >
+{
 worker
 .
 onmessage
 =
+resolve
+;
+worker
+.
+onerror
+=
 (
+err
 )
 =
 >
-{
-resolve
+reject
 (
+err
+.
+message
 )
 ;
 }
 )
 ;
+return
+worker
+;
+}
+finally
+{
 URL
 .
 revokeObjectURL
@@ -603,9 +624,7 @@
 url
 )
 ;
-return
-worker
-;
+}
 }
 promise_test
 (