зеркало из https://github.com/mozilla/gecko-dev.git
48 строки
1.1 KiB
HTML
48 строки
1.1 KiB
HTML
<!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";
|
|
|
|
function muteBeforePlay() {
|
|
ok(!iframe.contentWindow.pluginMuted(), "Plugin should not be muted");
|
|
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.
|
|
iframe.contentWindow.toggleMuteState(false);
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
iframe.onload = function() {
|
|
ok(true, "Already load iframe.");
|
|
muteBeforePlay();
|
|
}
|
|
}
|
|
|
|
onload = runTest;
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|