зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1656025 - Remove plugin related audio tests. r=baku
We're going to stop supporting Flash plugin soon, and we won't update the related code anymore. So we can remove those related tests which blocks Fission. Differential Revision: https://phabricator.services.mozilla.com/D85312
This commit is contained in:
Родитель
d70b8edad9
Коммит
5d9d1322dd
|
@ -1,21 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<embed type="application/x-test" width="200" height="200"></embed>
|
||||
<script>
|
||||
var plugin = document.querySelector("embed");
|
||||
|
||||
function startAudio() {
|
||||
plugin.startAudioPlayback();
|
||||
}
|
||||
|
||||
function stopAudio() {
|
||||
plugin.stopAudioPlayback();
|
||||
}
|
||||
|
||||
function pluginMuted() {
|
||||
return plugin.audioMuted();
|
||||
}
|
||||
|
||||
function toggleMuteState(muted) {
|
||||
return SpecialPowers.toggleMuteState(muted, window.top);
|
||||
}
|
||||
</script>
|
|
@ -206,7 +206,6 @@ support-files =
|
|||
file_webaudio_startstop.html
|
||||
file_webAudioAudible.html
|
||||
file_pluginAudio.html
|
||||
file_pluginAudioNonAutoStart.html
|
||||
noaudio.webm
|
||||
referrer_helper.js
|
||||
referrer_testserver.sjs
|
||||
|
@ -800,14 +799,6 @@ skip-if = toolkit == 'android' # We don't ship pdf.js on Android
|
|||
[test_plugin_freezing.html]
|
||||
skip-if = (os == 'win' && processor == 'aarch64')
|
||||
reason = Plugins are not supported on Windows/AArch64
|
||||
[test_pluginAudioNotification.html]
|
||||
tags = audiochannel
|
||||
skip-if = toolkit == 'android' # Plugins don't work on Android
|
||||
|| (xorigin && fission) # JavaScript error: resource://specialpowers/SpecialPowersChild.jsm, line 719: SecurityError: Permission denied to access property "windowGlobalChild" on cross-origin object
|
||||
[test_pluginMutedBeforePlay.html]
|
||||
tags = audiochannel
|
||||
skip-if = toolkit == 'android' # Plugins don't work on Android
|
||||
|| (xorigin && fission) # JavaScript error: , line 0: uncaught exception: Object
|
||||
[test_postMessage_solidus.html]
|
||||
[test_postMessages_window.html]
|
||||
[test_postMessages_workers.html]
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for audio controller in windows</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="plugin.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
<iframe></iframe>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var iframe = null;
|
||||
|
||||
function waitForObserver(expectedNotification) {
|
||||
return new Promise(resolve => {
|
||||
let observe = function(subject, topic, data) {
|
||||
is(topic, "audio-playback", "audio-playback received");
|
||||
is(data, expectedNotification, `${expectedNotification} is the right notification`);
|
||||
SpecialPowers.removeObserver(observe, "audio-playback");
|
||||
resolve();
|
||||
}
|
||||
|
||||
SpecialPowers.addObserver(observe, "audio-playback");
|
||||
});
|
||||
}
|
||||
|
||||
var tests = [
|
||||
async function() {
|
||||
iframe = document.querySelector("iframe");
|
||||
let observerPromise = waitForObserver('active');
|
||||
iframe.src = "file_pluginAudio.html";
|
||||
await observerPromise;
|
||||
},
|
||||
|
||||
async function() {
|
||||
info("=== Mute plugin ===");
|
||||
ok(!iframe.contentWindow.pluginMuted(), "Plugin should not be muted");
|
||||
let observerPromise = waitForObserver('inactive-nonaudible');
|
||||
iframe.contentWindow.toggleMuteState(true);
|
||||
await observerPromise;
|
||||
ok(iframe.contentWindow.pluginMuted(), "Plugin should be muted");
|
||||
},
|
||||
|
||||
async function() {
|
||||
info("=== unmute plugin ==");
|
||||
ok(iframe.contentWindow.pluginMuted(), "Plugin should be muted");
|
||||
let observerPromise = waitForObserver('active');
|
||||
iframe.contentWindow.toggleMuteState(false);
|
||||
await observerPromise;
|
||||
ok(!iframe.contentWindow.pluginMuted(), "Plugin should not be muted");
|
||||
},
|
||||
|
||||
async function() {
|
||||
info("=== stop audio ==");
|
||||
let observerPromise = waitForObserver('inactive-pause');
|
||||
iframe.contentWindow.stopAudio();
|
||||
await observerPromise;
|
||||
},
|
||||
];
|
||||
|
||||
async function runTest() {
|
||||
for (let test of tests) {
|
||||
await test();
|
||||
}
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
onload = runTest;
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,47 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mute window before the plugin starts playing</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="plugin.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
<iframe></iframe>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function runTest() {
|
||||
var iframe = document.querySelector("iframe");
|
||||
iframe.src = "file_pluginAudioNonAutoStart.html";
|
||||
|
||||
async function muteBeforePlay() {
|
||||
ok(!iframe.contentWindow.pluginMuted(), "Plugin should not be muted");
|
||||
await iframe.contentWindow.toggleMuteState(true);
|
||||
|
||||
iframe.contentWindow.startAudio();
|
||||
ok(iframe.contentWindow.pluginMuted(), "Plugin should still be muted after playing");
|
||||
|
||||
iframe.contentWindow.stopAudio();
|
||||
|
||||
// Reset the window's mute state, avoid to interrupt other tests.
|
||||
await iframe.contentWindow.toggleMuteState(false);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
iframe.onload = async function() {
|
||||
ok(true, "Already load iframe.");
|
||||
await muteBeforePlay();
|
||||
}
|
||||
}
|
||||
|
||||
onload = runTest;
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Загрузка…
Ссылка в новой задаче