[GTK] Layout Test http/tests/media/video-play-waiting.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=142489

Reviewed by Philippe Normand.

The test was failing with a timeout even after properly calling TestRunner.notifyDone()
internally because there was still an injectedBundle.topLoadingFrame() in InjectedBundlePage,
which means that the web page hadn't completely finished to be downloaded. This was caused
by the stalled video download that the test wants to exercise.

The solution is to set the video src to empty in order to convince TestRunner that the page
has finished downloading.

* http/tests/media/video-play-waiting.html: Set the video src to empty.
* platform/mac/TestExpectations: The test now just fails (for reasons unrelated to this fix) on mac instead of timing out.
* platform/glib/TestExpectations: Unskipped test.
* platform/win/TestExpectations: Unskipped test.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@286165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 125d8b5..5350a0f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,23 @@
+2021-11-25  Enrique Ocaña González  <eocanha@igalia.com>
+
+        [GTK] Layout Test http/tests/media/video-play-waiting.html is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=142489
+
+        Reviewed by Philippe Normand.
+
+        The test was failing with a timeout even after properly calling TestRunner.notifyDone()
+        internally because there was still an injectedBundle.topLoadingFrame() in InjectedBundlePage,
+        which means that the web page hadn't completely finished to be downloaded. This was caused
+        by the stalled video download that the test wants to exercise.
+
+        The solution is to set the video src to empty in order to convince TestRunner that the page
+        has finished downloading.
+
+        * http/tests/media/video-play-waiting.html: Set the video src to empty.
+        * platform/mac/TestExpectations: The test now just fails (for reasons unrelated to this fix) on mac instead of timing out.
+        * platform/glib/TestExpectations: Unskipped test.
+        * platform/win/TestExpectations: Unskipped test.
+
 2021-11-24  Ziran Sun  <zsun@igalia.com>
 
         [css-grid] Track sizing algorithm not repeated even if used flex fraction would change
diff --git a/LayoutTests/http/tests/media/video-play-waiting.html b/LayoutTests/http/tests/media/video-play-waiting.html
index 6329ca5..93cea63 100644
--- a/LayoutTests/http/tests/media/video-play-waiting.html
+++ b/LayoutTests/http/tests/media/video-play-waiting.html
@@ -9,7 +9,11 @@
     waitForEvent('durationchange');
     waitForEvent('loadedmetadata');
     waitForEvent('loadeddata');
-    waitForEventAndEnd('waiting');
+    waitForEventAndEnd('waiting', function() {
+        // TestRunner waits for the complete frame download before finishing, so having the video load stalled
+        // prevents TestRunner from finishing. Changing the src will abort the download and let the test finish.
+        video.src = "";
+    });
 
     waitForEvent('canplay', function () {
         run("video.play()");
diff --git a/LayoutTests/platform/glib/TestExpectations b/LayoutTests/platform/glib/TestExpectations
index 3c9c757..b57c39f 100644
--- a/LayoutTests/platform/glib/TestExpectations
+++ b/LayoutTests/platform/glib/TestExpectations
@@ -2356,7 +2356,6 @@
 
 webkit.org/b/137698 media/video-controls-drag.html [ Timeout ]
 webkit.org/b/141959 http/tests/media/clearkey/clear-key-hls-aes128.html [ Crash Timeout ]
-webkit.org/b/142489 http/tests/media/video-play-waiting.html [ Timeout ]
 webkit.org/b/130971 media/track/track-remove-track.html [ Timeout ]
 webkit.org/b/113127 media/track/track-prefer-captions.html [ Timeout ]
 
diff --git a/LayoutTests/platform/mac/TestExpectations b/LayoutTests/platform/mac/TestExpectations
index 6dd471c..865ea5b 100644
--- a/LayoutTests/platform/mac/TestExpectations
+++ b/LayoutTests/platform/mac/TestExpectations
@@ -745,8 +745,7 @@
 webkit.org/b/136708 http/tests/media/video-play-stall-seek.html
 webkit.org/b/136708 media/media-fullscreen-not-in-document.html
 
-webkit.org/b/140639 http/tests/media/video-play-waiting.html [ Pass Timeout ]
-
+webkit.org/b/140639 http/tests/media/video-play-waiting.html [ Failure ]
 # This test requires generation of progress events during loading
 webkit.org/b/100984 media/progress-events-generated-correctly.html [ Failure ]
 
diff --git a/LayoutTests/platform/win/TestExpectations b/LayoutTests/platform/win/TestExpectations
index 0fb9c39..ef75bd11 100644
--- a/LayoutTests/platform/win/TestExpectations
+++ b/LayoutTests/platform/win/TestExpectations
@@ -1097,7 +1097,6 @@
 # HTTP Timeouts
 http/tests/media/hls/video-cookie.html [ Skip ] # Timeout
 http/tests/media/video-buffered-range-contains-currentTime.html [ Skip ] # Timeout
-http/tests/media/video-play-waiting.html [ Skip ] # Timeout
 
 # Extra whitespace in the output
 #media/W3C/video/canPlayType/canPlayType_codecs_order_2.html [ Failure ]