mirror of
https://github.com/servo/servo.git
synced 2025-08-29 17:18:23 +01:00
Update web-platform-tests to revision 4333a1d2f109795547fc5e22ebfc8481fa649de7
This commit is contained in:
parent
728ebcc932
commit
8c46b67f8e
456 changed files with 10561 additions and 5108 deletions
|
@ -19,29 +19,20 @@
|
|||
<script>
|
||||
'use strict';
|
||||
|
||||
function doIdlTest([dom, idlText]) {
|
||||
promise_test(async () => {
|
||||
const main = await fetch('/interfaces/mediacapture-main.idl').then(r => r.text());
|
||||
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
|
||||
const html = await fetch('/interfaces/html.idl').then(r => r.text());
|
||||
|
||||
var idl_array = new IdlArray();
|
||||
|
||||
// dummies
|
||||
idl_array.add_untested_idls(dom, { only: ['Event', 'EventInit']});
|
||||
idl_array.add_untested_idls("interface Navigator {};");
|
||||
idl_array.add_untested_idls("interface EventTarget {};");
|
||||
idl_array.add_untested_idls("interface EventHandler {};");
|
||||
|
||||
idl_array.add_idls(idlText);
|
||||
|
||||
idl_array.add_objects({"Navigator": ["navigator"]});
|
||||
idl_array.add_objects({"MediaDevices":["navigator.mediaDevices"]});
|
||||
idl_array.add_idls(main);
|
||||
idl_array.add_dependency_idls(html);
|
||||
idl_array.add_dependency_idls(dom);
|
||||
idl_array.add_objects({
|
||||
Navigator: ["navigator"],
|
||||
MediaDevices: ["navigator.mediaDevices"]
|
||||
});
|
||||
idl_array.test();
|
||||
}
|
||||
|
||||
promise_test(() => {
|
||||
return Promise.all(
|
||||
[
|
||||
'/interfaces/dom.idl',
|
||||
'/interfaces/mediacapture-main.idl',
|
||||
].map(url => fetch(url).then(r => r.text())))
|
||||
.then(doIdlTest);
|
||||
}, 'Test driver')
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -20,13 +20,15 @@
|
|||
<script>
|
||||
"use strict";
|
||||
|
||||
function doIdlTest([dom, idlText]) {
|
||||
const MDI_idl = new IdlArray();
|
||||
promise_test(async () => {
|
||||
const idl = await fetch(`/interfaces/mediacapture-main.idl`).then(r => r.text());
|
||||
const dom = await fetch(`/interfaces/dom.idl`).then(r => r.text());
|
||||
const html = await fetch(`/interfaces/html.idl`).then(r => r.text());
|
||||
|
||||
MDI_idl.add_untested_idls(dom, { only: ['Event', 'EventInit'] });
|
||||
MDI_idl.add_untested_idls("interface EventTarget {};");
|
||||
MDI_idl.add_untested_idls("interface Navigator {};");
|
||||
MDI_idl.add_idls(idlText);
|
||||
const MDI_idl = new IdlArray();
|
||||
MDI_idl.add_idls(idl);
|
||||
MDI_idl.add_dependency_idls(html);
|
||||
MDI_idl.add_dependency_idls(dom);
|
||||
|
||||
assert_true(undefined !== navigator.mediaDevices.enumerateDevices,
|
||||
"navigator.mediaDevices.enumerateDevices exists");
|
||||
|
@ -56,16 +58,6 @@
|
|||
|
||||
MDI_idl.test();
|
||||
});
|
||||
}
|
||||
|
||||
promise_test(() => {
|
||||
return Promise.all(
|
||||
[
|
||||
'/interfaces/dom.idl',
|
||||
'/interfaces/mediacapture-main.idl',
|
||||
].map(url => fetch(url).then(r => r.text())))
|
||||
.then(doIdlTest);
|
||||
|
||||
}, "Test MediaDevices.enumerateDevices call and result. Types only.");
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -75,4 +75,36 @@
|
|||
}
|
||||
});
|
||||
}, 'groupId is correctly reported by getSettings() for all devices');
|
||||
|
||||
promise_test(t => {
|
||||
return navigator.mediaDevices.getUserMedia({audio: true}).then(stream => {
|
||||
let settings = stream.getAudioTracks()[0].getSettings();
|
||||
assert_equals(typeof(settings.deviceId), "string",
|
||||
"deviceId should exist and it should be a string.");
|
||||
assert_equals(typeof(settings.groupId), "string",
|
||||
"groupId should exist and it should be a string.");
|
||||
assert_equals(typeof(settings.volume), "number",
|
||||
"volume should exist and it should be a number.");
|
||||
assert_true(settings.volume >= 0.0 && settings.volume <= 1.0,
|
||||
"volume should be a number in the range [0.0, 1.0].");
|
||||
assert_equals(typeof(settings.sampleRate), "number",
|
||||
"sampleRate should exist and it should be a number.");
|
||||
assert_true(settings.sampleRate > 0, "sampleRate should be positive.");
|
||||
assert_equals(typeof(settings.sampleSize), "number",
|
||||
"sampleSize should exist and it should be a number.");
|
||||
assert_true(settings.sampleSize > 0, "sampleSize should be positive.");
|
||||
assert_equals(typeof(settings.echoCancellation), "boolean",
|
||||
"echoCancellation should exist and it should be a boolean.");
|
||||
assert_equals(typeof(settings.autoGainControl), "boolean",
|
||||
"autoGainControl should exist and it should be a boolean.");
|
||||
assert_equals(typeof(settings.noiseSuppression), "boolean",
|
||||
"noiseSuppression should exist and it should be a boolean.");
|
||||
assert_equals(typeof(settings.latency), "number",
|
||||
"latency should exist and it should be a number.");
|
||||
assert_true(settings.latency >= 0, "latency should not be negative.");
|
||||
assert_equals(typeof(settings.channelCount), "number",
|
||||
"channelCount should exist and it should be a number.");
|
||||
assert_true(settings.channelCount > 0, "channelCount should be positive.");
|
||||
});
|
||||
}, 'audio properties are reported by getSettings()');
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue