Update web-platform-tests to revision 14cfa4d648cc1c853b4153268df672d21425f8c1

This commit is contained in:
Josh Matthews 2017-10-30 09:31:22 -04:00
parent 1b73cf3352
commit 75736751d9
1213 changed files with 19434 additions and 12344 deletions

View file

@ -2,8 +2,8 @@
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/common/get-host-info.sub.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<script src=util/utils.js></script>
<script>
'use strict';
@ -33,8 +33,9 @@
});
};
var cross_domain = get_host_info().HTTPS_REMOTE_ORIGIN;
run_all_fp_tests_allow_self(
'https://{{domains[www]}}:{{ports[https][0]}}',
cross_domain,
'microphone',
'[object NavigatorUserMediaError]',
function() {
@ -42,7 +43,7 @@
});
run_all_fp_tests_allow_self(
'https://{{domains[www]}}:{{ports[https][0]}}',
cross_domain,
'camera',
'[object NavigatorUserMediaError]',
function() {
@ -50,7 +51,7 @@
});
run_all_fp_tests_allow_self(
'https://{{domains[www]}}:{{ports[https][0]}}',
cross_domain,
'camera; microphone',
'[object NavigatorUserMediaError]',
function() {

View file

@ -0,0 +1,52 @@
<!doctype html>
<title>MediaStreamTrack IDL tests</title>
<link rel="help" href="https://w3c.github.io/mediacapture-main/#media-stream-track-interface-definition">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>
<script>
function idl_test([dom_idl, stream]) {
const idl_array = new IdlArray();
idl_array.add_untested_idls(dom_idl);
idl_array.add_untested_idls('interface EventHandler {};');
idl_array.add_idls("interface MediaStreamTrack : EventTarget {\
readonly attribute DOMString kind;\
readonly attribute DOMString id;\
readonly attribute DOMString label;\
attribute boolean enabled;\
readonly attribute boolean muted;\
attribute EventHandler onmute;\
attribute EventHandler onunmute;\
readonly attribute MediaStreamTrackState readyState;\
attribute EventHandler onended;\
attribute EventHandler onoverconstrained;\
MediaStreamTrack clone ();\
void stop ();\
MediaTrackCapabilities getCapabilities ();\
MediaTrackConstraints getConstraints ();\
MediaTrackSettings getSettings ();\
Promise<void> applyConstraints (optional MediaTrackConstraints constraints);\
};\
\
enum MediaStreamTrackState {\
\"live\",\
\"ended\"\
};");
self.track = stream.getTracks()[0];
idl_array.add_objects({MediaStreamTrack: ["track"]});
idl_array.test();
}
promise_test(() => {
return Promise.all([
fetch("/interfaces/dom.idl").then(response => response.text()),
navigator.mediaDevices.getUserMedia({audio: true}),
]).then(idl_test);
}, "Test driver")
</script>
</body>
</html>

View file

@ -18,53 +18,19 @@ object returned by the success callback in getUserMedia is correctly initialized
<div id='log'></div>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/resources/WebIDLParser.js></script>
<script src=/resources/idlharness.js></script>
<script>
var t = async_test("Tests that the video MediaStreamTrack objects are properly initialized", {timeout:10000});
var track = null
var idl_array = new IdlArray();
idl_array.add_idls("interface EventTarget {\
void addEventListener(DOMString type, EventListener? callback, optional boolean capture = false);\
void removeEventListener(DOMString type, EventListener? callback, optional boolean capture = false);\
boolean dispatchEvent(Event event);\
};");
idl_array.add_idls("interface MediaStreamTrack : EventTarget {\
readonly attribute DOMString kind;\
readonly attribute DOMString id;\
readonly attribute DOMString label;\
attribute boolean enabled;\
readonly attribute boolean muted;\
attribute EventHandler onmute;\
attribute EventHandler onunmute;\
readonly attribute MediaStreamTrackState readyState;\
attribute EventHandler onended;\
attribute EventHandler onoverconstrained;\
MediaStreamTrack clone ();\
void stop ();\
MediaTrackCapabilities getCapabilities ();\
MediaTrackConstraints getConstraints ();\
MediaTrackSettings getSettings ();\
Promise<void> applyConstraints (optional MediaTrackConstraints constraints);\
};");
t.step(function () {
navigator.mediaDevices.getUserMedia({video: true})
.then(t.step_func(function (stream) {
promise_test(() => {
return navigator.mediaDevices.getUserMedia({video: true})
.then(stream => {
var videoTracks = stream.getVideoTracks();
assert_equals(videoTracks.length, 1, "There is exactly one video track in the media stream");
track = videoTracks[0];
idl_array.add_objects({MediaStreamTrack: ["track"]});
idl_array.test();
assert_equals(track.readyState, "live", "The track object is in live state");
assert_equals(track.kind, "video", "The track object is of video kind");
// Not clear that this is required by the spec,
// see https://www.w3.org/Bugs/Public/show_bug.cgi?id=22212
assert_true(track.enabled, "The track object is enabed");
t.done();
}));
});
});
</script>
</body>

View file

@ -1,3 +1,5 @@
@agouaillard
@alvestrand
@dontcallmedom
@eric-carlson
@youennf