Diff
Modified: trunk/LayoutTests/ChangeLog (251029 => 251030)
--- trunk/LayoutTests/ChangeLog 2019-10-11 23:29:02 UTC (rev 251029)
+++ trunk/LayoutTests/ChangeLog 2019-10-11 23:47:44 UTC (rev 251030)
@@ -1,3 +1,21 @@
+2019-10-11 Peng Liu <peng.l...@apple.com>
+
+ Layout Test media/W3C/audio/events/event_progress.html is flaky
+ https://bugs.webkit.org/show_bug.cgi?id=181966
+ <rdar://problem/51449034>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Use the option {once: true} in addEventListener instead of a variable to avoid
+ executing the event handler more than once.
+
+ * media/W3C/audio/events/event_order_loadstart_progress.html:
+ * media/W3C/audio/events/event_progress.html:
+ * media/W3C/audio/events/event_progress_manual.html:
+ * media/W3C/video/events/event_order_loadstart_progress.html:
+ * media/W3C/video/events/event_progress.html:
+ * media/W3C/video/events/event_progress_manual.html:
+
2019-10-11 Dean Jackson <d...@apple.com>
Layout Test fast/events/touch/ios/tap-with-passive-listener-inside-active-listener.html is a Flaky Failure
Modified: trunk/LayoutTests/media/W3C/audio/events/event_order_loadstart_progress.html (251029 => 251030)
--- trunk/LayoutTests/media/W3C/audio/events/event_order_loadstart_progress.html 2019-10-11 23:29:02 UTC (rev 251029)
+++ trunk/LayoutTests/media/W3C/audio/events/event_order_loadstart_progress.html 2019-10-11 23:47:44 UTC (rev 251030)
@@ -17,17 +17,13 @@
found_loadstart = true;
});
-var firstProgressEvent = true;
a.addEventListener("progress", function() {
- if (!firstProgressEvent) return;
- firstProgressEvent = false;
-
t.step(function() {
assert_true(found_loadstart);
});
t.done();
a.pause();
-});
+}, { once: true });
a.src = ""
</script>
</body>
Modified: trunk/LayoutTests/media/W3C/audio/events/event_progress.html (251029 => 251030)
--- trunk/LayoutTests/media/W3C/audio/events/event_progress.html 2019-10-11 23:29:02 UTC (rev 251029)
+++ trunk/LayoutTests/media/W3C/audio/events/event_progress.html 2019-10-11 23:47:44 UTC (rev 251030)
@@ -12,17 +12,13 @@
<script>
var t = async_test("setting src attribute on autoplay video should trigger progress event", {timeout:30000});
var a = document.getElementById("a");
-var firstProgressEvent = true;
-
a.addEventListener("progress", function() {
- if (!firstProgressEvent) return;
- firstProgressEvent = false;
t.step(function() {
assert_true(true);
});
t.done();
a.pause();
-});
+}, { once: true });
a.src = ""
</script>
</body>
Modified: trunk/LayoutTests/media/W3C/audio/events/event_progress_manual.html (251029 => 251030)
--- trunk/LayoutTests/media/W3C/audio/events/event_progress_manual.html 2019-10-11 23:29:02 UTC (rev 251029)
+++ trunk/LayoutTests/media/W3C/audio/events/event_progress_manual.html 2019-10-11 23:47:44 UTC (rev 251030)
@@ -12,17 +12,12 @@
<script>
var t = async_test("setting src attribute on non-autoplay video should trigger progress event", {timeout:30000});
var a = document.getElementById("a");
-
-var firstProgressEvent = true;
a.addEventListener("progress", function() {
- if (!firstProgressEvent) return;
- firstProgressEvent = false;
-
t.step(function() {
assert_true(true);
});
t.done();
-});
+}, { once: true});
a.src = ""
</script>
</body>
Modified: trunk/LayoutTests/media/W3C/video/events/event_order_loadstart_progress.html (251029 => 251030)
--- trunk/LayoutTests/media/W3C/video/events/event_order_loadstart_progress.html 2019-10-11 23:29:02 UTC (rev 251029)
+++ trunk/LayoutTests/media/W3C/video/events/event_order_loadstart_progress.html 2019-10-11 23:47:44 UTC (rev 251030)
@@ -17,16 +17,13 @@
found_loadstart = true;
});
-var firstProgressEvent = true;
v.addEventListener("progress", function() {
- if (!firstProgressEvent) return;
- firstProgressEvent = false;
t.step(function() {
assert_true(found_loadstart);
});
t.done();
v.pause();
-});
+}, { once: true });
v.src = ""
</script>
</body>
Modified: trunk/LayoutTests/media/W3C/video/events/event_progress.html (251029 => 251030)
--- trunk/LayoutTests/media/W3C/video/events/event_progress.html 2019-10-11 23:29:02 UTC (rev 251029)
+++ trunk/LayoutTests/media/W3C/video/events/event_progress.html 2019-10-11 23:47:44 UTC (rev 251030)
@@ -12,18 +12,13 @@
<script>
var t = async_test("setting src attribute on autoplay video should trigger progress event", {timeout:30000});
var v = document.getElementById("v");
-
-var firstProgressEvent = true;
v.addEventListener("progress", function() {
- if (!firstProgressEvent) return;
- firstProgressEvent = false;
-
t.step(function() {
assert_true(true);
});
t.done();
v.pause();
-});
+}, { once: true });
v.src = ""
</script>
</body>
Modified: trunk/LayoutTests/media/W3C/video/events/event_progress_manual.html (251029 => 251030)
--- trunk/LayoutTests/media/W3C/video/events/event_progress_manual.html 2019-10-11 23:29:02 UTC (rev 251029)
+++ trunk/LayoutTests/media/W3C/video/events/event_progress_manual.html 2019-10-11 23:47:44 UTC (rev 251030)
@@ -12,17 +12,12 @@
<script>
var t = async_test("setting src attribute on non-autoplay video should trigger progress event", {timeout:30000});
var v = document.getElementById("v");
-
-var firstProgressEvent = true;
v.addEventListener("progress", function() {
- if (!firstProgressEvent) return;
- firstProgressEvent = false;
-
t.step(function() {
assert_true(true);
});
t.done();
-});
+}, { once: true });
v.src = ""
</script>
</body>