mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1188487 - Tests for BrowserElement mute / set volume. r=fabrice
This commit is contained in:
parent
ce79c6b136
commit
2f29d359c9
@ -18,6 +18,12 @@ function noaudio() {
|
||||
iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/file_empty.html';
|
||||
|
||||
function noaudio_loadend() {
|
||||
ok("mute" in iframe, "iframe.mute exists");
|
||||
ok("unmute" in iframe, "iframe.unmute exists");
|
||||
ok("getMuted" in iframe, "iframe.getMuted exists");
|
||||
ok("getVolume" in iframe, "iframe.getVolume exists");
|
||||
ok("setVolume" in iframe, "iframe.setVolume exists");
|
||||
|
||||
ok("allowedAudioChannels" in iframe, "allowedAudioChannels exist");
|
||||
var channels = iframe.allowedAudioChannels;
|
||||
is(channels.length, 1, "1 audio channel by default");
|
||||
@ -40,6 +46,42 @@ function noaudio() {
|
||||
}
|
||||
})
|
||||
|
||||
.then(function() {
|
||||
return new Promise(function(resolve) {
|
||||
iframe.mute();
|
||||
iframe.getMuted()
|
||||
.then(result => is(result, true, "iframe.getMuted should be true."))
|
||||
.then(resolve);
|
||||
});
|
||||
})
|
||||
|
||||
.then(function() {
|
||||
return new Promise(function(resolve) {
|
||||
iframe.unmute();
|
||||
iframe.getMuted()
|
||||
.then(result => is(result, false, "iframe.getMuted should be false."))
|
||||
.then(resolve);
|
||||
});
|
||||
})
|
||||
|
||||
.then(function() {
|
||||
return new Promise(function(resolve) {
|
||||
iframe.setVolume(0);
|
||||
iframe.getVolume()
|
||||
.then(result => is(result, 0, "iframe.getVolume should be 0."))
|
||||
.then(resolve);
|
||||
});
|
||||
})
|
||||
|
||||
.then(function() {
|
||||
return new Promise(function(resolve) {
|
||||
iframe.setVolume(1);
|
||||
iframe.getVolume()
|
||||
.then(result => is(result, 1, "iframe.getVolume should be 1."))
|
||||
.then(resolve);
|
||||
});
|
||||
})
|
||||
|
||||
.then(function() {
|
||||
return new Promise(function(r, rr) {
|
||||
ac.getMuted().onsuccess = function(e) {
|
||||
@ -109,6 +151,12 @@ function audio() {
|
||||
iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/iframe_file_audio.html';
|
||||
|
||||
function audio_loadend() {
|
||||
ok("mute" in iframe, "iframe.mute exists");
|
||||
ok("unmute" in iframe, "iframe.unmute exists");
|
||||
ok("getMuted" in iframe, "iframe.getMuted exists");
|
||||
ok("getVolume" in iframe, "iframe.getVolume exists");
|
||||
ok("setVolume" in iframe, "iframe.setVolume exists");
|
||||
|
||||
ok("allowedAudioChannels" in iframe, "allowedAudioChannels exist");
|
||||
var channels = iframe.allowedAudioChannels;
|
||||
is(channels.length, 1, "1 audio channel by default");
|
||||
|
Loading…
Reference in New Issue
Block a user