From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../autoplay/test/mochitest/AutoplayTestUtils.js | 46 +++++ .../file_autoplay_gv_play_request_frame.html | 24 +++ .../file_autoplay_gv_play_request_window.html | 65 ++++++ .../file_autoplay_policy_activation_frame.html | 32 +++ .../file_autoplay_policy_activation_window.html | 80 ++++++++ .../file_autoplay_policy_eventdown_activation.html | 85 ++++++++ .../file_autoplay_policy_key_blacklist.html | 148 ++++++++++++++ ...autoplay_policy_play_before_loadedmetadata.html | 63 ++++++ .../file_autoplay_policy_unmute_pauses.html | 65 ++++++ dom/media/autoplay/test/mochitest/mochitest.ini | 54 +++++ .../autoplay/test/mochitest/test_autoplay.html | 36 ++++ .../mochitest/test_autoplay_contentEditable.html | 67 +++++++ .../mochitest/test_autoplay_gv_play_request.html | 221 +++++++++++++++++++++ .../test/mochitest/test_autoplay_policy.html | 174 ++++++++++++++++ .../mochitest/test_autoplay_policy_activation.html | 180 +++++++++++++++++ .../test_autoplay_policy_eventdown_activation.html | 55 +++++ .../test_autoplay_policy_key_blacklist.html | 47 +++++ .../mochitest/test_autoplay_policy_permission.html | 80 ++++++++ ...autoplay_policy_play_before_loadedmetadata.html | 73 +++++++ .../test_autoplay_policy_unmute_pauses.html | 64 ++++++ ...autoplay_policy_web_audio_AudioParamStream.html | 171 ++++++++++++++++ ...y_policy_web_audio_createMediaStreamSource.html | 119 +++++++++++ ...licy_web_audio_mediaElementAudioSourceNode.html | 105 ++++++++++ ..._notResumePageInvokedSuspendedAudioContext.html | 96 +++++++++ .../test/mochitest/test_streams_autoplay.html | 47 +++++ 25 files changed, 2197 insertions(+) create mode 100644 dom/media/autoplay/test/mochitest/AutoplayTestUtils.js create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_frame.html create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_window.html create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_window.html create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_policy_eventdown_activation.html create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_policy_key_blacklist.html create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_policy_play_before_loadedmetadata.html create mode 100644 dom/media/autoplay/test/mochitest/file_autoplay_policy_unmute_pauses.html create mode 100644 dom/media/autoplay/test/mochitest/mochitest.ini create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_contentEditable.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_gv_play_request.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_activation.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_eventdown_activation.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_key_blacklist.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_permission.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_play_before_loadedmetadata.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_unmute_pauses.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_AudioParamStream.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_createMediaStreamSource.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_mediaElementAudioSourceNode.html create mode 100644 dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_notResumePageInvokedSuspendedAudioContext.html create mode 100644 dom/media/autoplay/test/mochitest/test_streams_autoplay.html (limited to 'dom/media/autoplay/test/mochitest') diff --git a/dom/media/autoplay/test/mochitest/AutoplayTestUtils.js b/dom/media/autoplay/test/mochitest/AutoplayTestUtils.js new file mode 100644 index 0000000000..aa8990c9d9 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/AutoplayTestUtils.js @@ -0,0 +1,46 @@ +/* import-globals-from ../../../test/manifest.js */ + +function playAndPostResult(muted, parent_window) { + let element = document.createElement("video"); + element.preload = "auto"; + element.muted = muted; + element.src = "short.mp4"; + element.id = "video"; + document.body.appendChild(element); + element.play().then( + () => { + parent_window.postMessage( + { played: true, allowedToPlay: element.allowedToPlay }, + "*" + ); + }, + () => { + parent_window.postMessage( + { played: false, allowedToPlay: element.allowedToPlay }, + "*" + ); + } + ); +} + +function nextWindowMessage() { + return nextEvent(window, "message"); +} + +function log(msg) { + var log_pane = document.body; + log_pane.appendChild(document.createTextNode(msg)); + log_pane.appendChild(document.createElement("br")); +} + +const autoplayPermission = "autoplay-media"; + +async function pushAutoplayAllowedPermission() { + return SpecialPowers.pushPermissions([ + { + type: autoplayPermission, + allow: true, + context: document, + }, + ]); +} diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_frame.html b/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_frame.html new file mode 100644 index 0000000000..de5ad1989f --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_frame.html @@ -0,0 +1,24 @@ + + + + GV autoplay play request test + + + + + + + + diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_window.html b/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_window.html new file mode 100644 index 0000000000..56e4e1031c --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_gv_play_request_window.html @@ -0,0 +1,65 @@ + + + + GV autoplay play request test + + + + + + + + + diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html new file mode 100644 index 0000000000..5dfb3da862 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_frame.html @@ -0,0 +1,32 @@ + + + + Autoplay policy frame + + + + + + + + + diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_window.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_window.html new file mode 100644 index 0000000000..60c5a0cec1 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_policy_activation_window.html @@ -0,0 +1,80 @@ + + + + Autoplay policy window + + + + + + + +
+      
+    
+ + diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_policy_eventdown_activation.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_eventdown_activation.html new file mode 100644 index 0000000000..e25b6401d1 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_policy_eventdown_activation.html @@ -0,0 +1,85 @@ + + + + + Autoplay policy window + + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_policy_key_blacklist.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_key_blacklist.html new file mode 100644 index 0000000000..c9982f932a --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_policy_key_blacklist.html @@ -0,0 +1,148 @@ + + + + + Autoplay policy window + + + + + + + + +
This is a div with id=x.
+
+      
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_policy_play_before_loadedmetadata.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_play_before_loadedmetadata.html new file mode 100644 index 0000000000..3594d0f236 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_policy_play_before_loadedmetadata.html @@ -0,0 +1,63 @@ + + + + + Autoplay policy window + + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/file_autoplay_policy_unmute_pauses.html b/dom/media/autoplay/test/mochitest/file_autoplay_policy_unmute_pauses.html new file mode 100644 index 0000000000..125ee156b6 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/file_autoplay_policy_unmute_pauses.html @@ -0,0 +1,65 @@ + + + + + Autoplay policy window + + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/mochitest.ini b/dom/media/autoplay/test/mochitest/mochitest.ini new file mode 100644 index 0000000000..f25b12e953 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/mochitest.ini @@ -0,0 +1,54 @@ +[DEFAULT] +subsuite = media +tags = autoplay +support-files = + ../../../test/manifest.js + ../../../test/320x240.ogv + ../../../test/bogus.duh + ../../../test/detodos-short.opus + ../../../test/flac-s24.flac + ../../../test/gizmo.mp4 + ../../../test/gizmo.webm + ../../../test/gizmo-noaudio.mp4 + ../../../test/gizmo-noaudio.webm + ../../../test/gizmo-short.mp4 + ../../../test/r11025_s16_c1-short.wav + ../../../test/sample.3g2 + ../../../test/sample.3gp + ../../../test/short.mp4 + ../../../test/seek-short.webm + ../../../test/small-shot.flac + ../../../test/small-shot.m4a + ../../../test/small-shot.mp3 + ../../../test/small-shot-mp3.mp4 + ../../../test/small-shot.ogg + ../../../test/vp9-short.webm + AutoplayTestUtils.js + file_autoplay_gv_play_request_frame.html + file_autoplay_gv_play_request_window.html + file_autoplay_policy_activation_frame.html + file_autoplay_policy_activation_window.html + file_autoplay_policy_eventdown_activation.html + file_autoplay_policy_play_before_loadedmetadata.html + file_autoplay_policy_unmute_pauses.html + file_autoplay_policy_key_blacklist.html + +[test_autoplay.html] +[test_autoplay_contentEditable.html] +[test_autoplay_gv_play_request.html] +skip-if = toolkit != 'android' +[test_autoplay_policy.html] +[test_autoplay_policy_activation.html] +[test_autoplay_policy_play_before_loadedmetadata.html] +skip-if = toolkit == 'android' # bug 1591121 +[test_autoplay_policy_eventdown_activation.html] +[test_autoplay_policy_permission.html] +[test_autoplay_policy_unmute_pauses.html] +[test_autoplay_policy_key_blacklist.html] +skip-if = (verify && debug && (os == 'win')) # bug 1424903 +[test_autoplay_policy_web_audio_notResumePageInvokedSuspendedAudioContext.html] +[test_autoplay_policy_web_audio_mediaElementAudioSourceNode.html] +[test_autoplay_policy_web_audio_AudioParamStream.html] +[test_autoplay_policy_web_audio_createMediaStreamSource.html] +[test_streams_autoplay.html] +tags=mtg capturestream diff --git a/dom/media/autoplay/test/mochitest/test_autoplay.html b/dom/media/autoplay/test/mochitest/test_autoplay.html new file mode 100644 index 0000000000..aa936f976d --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay.html @@ -0,0 +1,36 @@ + + + + Media test: autoplay attribute + + + + + + + +
+
+
+ + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_contentEditable.html b/dom/media/autoplay/test/mochitest/test_autoplay_contentEditable.html new file mode 100644 index 0000000000..0c0ec31797 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_contentEditable.html @@ -0,0 +1,67 @@ + + + + Media test: play() method + + + + + +
+
+
+
+ + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_gv_play_request.html b/dom/media/autoplay/test/mochitest/test_autoplay_gv_play_request.html new file mode 100644 index 0000000000..760c452592 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_gv_play_request.html @@ -0,0 +1,221 @@ + + + + GV Autoplay policy test + + + + + + + + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy.html new file mode 100644 index 0000000000..dae388b21d --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy.html @@ -0,0 +1,174 @@ + + + + + Autoplay policy test + + + + + +
+
+
diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_activation.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_activation.html
new file mode 100644
index 0000000000..eae266030e
--- /dev/null
+++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_activation.html
@@ -0,0 +1,180 @@
+
+
+  
+    Autoplay policy test
+    
+    
+    
+    
+  
+  
+    
+      
+    
+ + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_eventdown_activation.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_eventdown_activation.html new file mode 100644 index 0000000000..878f996ec5 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_eventdown_activation.html @@ -0,0 +1,55 @@ + + + + + Autoplay policy test + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_key_blacklist.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_key_blacklist.html new file mode 100644 index 0000000000..a85c63713a --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_key_blacklist.html @@ -0,0 +1,47 @@ + + + + + Autoplay policy test + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_permission.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_permission.html new file mode 100644 index 0000000000..b91e4d7be8 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_permission.html @@ -0,0 +1,80 @@ + + + + + Autoplay policy test + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_play_before_loadedmetadata.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_play_before_loadedmetadata.html new file mode 100644 index 0000000000..b5f70be227 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_play_before_loadedmetadata.html @@ -0,0 +1,73 @@ + + + + + Autoplay policy test + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_unmute_pauses.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_unmute_pauses.html new file mode 100644 index 0000000000..29ce4b801f --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_unmute_pauses.html @@ -0,0 +1,64 @@ + + + + + Autoplay policy test + + + + + + + +
+      
+    
+ + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_AudioParamStream.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_AudioParamStream.html new file mode 100644 index 0000000000..27dfa5388f --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_AudioParamStream.html @@ -0,0 +1,171 @@ + + + + Autoplay policy test : suspend/resume the AudioParam's stream + + + + + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_createMediaStreamSource.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_createMediaStreamSource.html new file mode 100644 index 0000000000..5fe9aa64fc --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_createMediaStreamSource.html @@ -0,0 +1,119 @@ + + + + Autoplay policy test : createMediaStreamSource with active stream + + + + + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_mediaElementAudioSourceNode.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_mediaElementAudioSourceNode.html new file mode 100644 index 0000000000..41fab54133 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_mediaElementAudioSourceNode.html @@ -0,0 +1,105 @@ + + + + Autoplay policy test : use media element as source for web audio + + + + + + diff --git a/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_notResumePageInvokedSuspendedAudioContext.html b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_notResumePageInvokedSuspendedAudioContext.html new file mode 100644 index 0000000000..46df256391 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay_policy_web_audio_notResumePageInvokedSuspendedAudioContext.html @@ -0,0 +1,96 @@ + + + + Autoplay policy test : do not resume AudioContext which is suspended by page + + + + + + diff --git a/dom/media/autoplay/test/mochitest/test_streams_autoplay.html b/dom/media/autoplay/test/mochitest/test_streams_autoplay.html new file mode 100644 index 0000000000..0b8630a323 --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_streams_autoplay.html @@ -0,0 +1,47 @@ + + + + Test that a MediaStream source triggers autoplay + + + + + +
+
+
+ + -- cgit v1.2.3