Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-07-15 21:59:16 UTC (rev 264427)
@@ -1,5 +1,23 @@
2020-07-15 Chris Dumez <[email protected]>
+ Resync web-platform-tests/mediacapture-streams from upstream
+ https://bugs.webkit.org/show_bug.cgi?id=214374
+
+ Reviewed by Geoffrey Garen.
+
+ Resync web-platform-tests/mediacapture-streams from upstream b2a666d93581a71e9338b2.
+
+ * web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https-expected.txt:
+ * web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html:
+ * web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html:
+ * web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https-expected.txt:
+ * web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html:
+ * web-platform-tests/mediacapture-streams/MediaStreamTrackEvent-constructor.https.html:
+ * web-platform-tests/mediacapture-streams/historical.https.html:
+ * web-platform-tests/mediacapture-streams/idlharness.https.window.js:
+
+2020-07-15 Chris Dumez <[email protected]>
+
Resync web-platform-tests/svg from upstream
https://bugs.webkit.org/show_bug.cgi?id=214323
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https-expected.txt (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https-expected.txt 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https-expected.txt 2020-07-15 21:59:16 UTC (rev 264427)
@@ -3,6 +3,7 @@
This test checks for the presence of the navigator.mediaDevices.enumerateDevices() method.
-PASS mediaDevices.enumerateDevices() is present and working
+PASS mediaDevices.enumerateDevices() is present and working - before capture
+PASS mediaDevices.enumerateDevices() is present and working - after capture
FAIL InputDeviceInfo is supported promise_test: Unhandled rejection with value: object "ReferenceError: Can't find variable: InputDeviceInfo"
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html 2020-07-15 21:59:16 UTC (rev 264427)
@@ -15,22 +15,37 @@
<script src=""
<script>
"use strict";
+
//NOTE ALEX: for completion, a test for ondevicechange event is missing.
+
promise_test(async () => {
assert_not_equals(navigator.mediaDevices.enumerateDevices, undefined, "navigator.mediaDevices.enumerateDevices exists");
const deviceList = await navigator.mediaDevices.enumerateDevices();
for (const mediaInfo of deviceList) {
- assert_not_equals(mediaInfo.deviceId, undefined, "mediaInfo's deviceId should exist.");
- assert_not_equals(mediaInfo.kind, undefined, "mediaInfo's kind should exist.");
- assert_not_equals(mediaInfo.label, undefined, "mediaInfo's label should exist.");
- assert_not_equals(mediaInfo.groupId, undefined, "mediaInfo's groupId should exist.");
+ assert_not_equals(mediaInfo.kind, undefined, "mediaInfo's kind should exist.");
+ assert_equals(mediaInfo.deviceId, "", "mediaInfo's deviceId should exist and be empty if getUserMedia was never called successfully.");
+ assert_equals(mediaInfo.label, "", "mediaInfo's label should exist and be empty if getUserMedia was never called successfully.");
+ assert_equals(mediaInfo.groupId, "", "mediaInfo's groupId should exist and be empty if getUserMedia was never called successfully.");
assert_in_array(mediaInfo.kind, ["videoinput", "audioinput", "audiooutput"]);
}
-}, "mediaDevices.enumerateDevices() is present and working");
+ assert_less_than_equal(deviceList.filter((item) => { return item.kind == "audioinput"; }).length, 1, "there should be zero or one audio input device ");
+ assert_less_than_equal(deviceList.filter((item) => { return item.kind == "videoinput"; }).length, 1, "there should be zero or one video input device ");
+}, "mediaDevices.enumerateDevices() is present and working - before capture");
+
promise_test(async () => {
+ await navigator.mediaDevices.getUserMedia({ audio : true });
const deviceList = await navigator.mediaDevices.enumerateDevices();
for (const mediaInfo of deviceList) {
+ assert_not_equals(mediaInfo.kind, undefined, "mediaInfo's kind should exist.");
+ assert_not_equals(mediaInfo.deviceId, "", "mediaInfo's deviceId should exist and not be empty.");
+ assert_in_array(mediaInfo.kind, ["videoinput", "audioinput", "audiooutput"]);
+ }
+}, "mediaDevices.enumerateDevices() is present and working - after capture");
+
+promise_test(async () => {
+ const deviceList = await navigator.mediaDevices.enumerateDevices();
+ for (const mediaInfo of deviceList) {
if (mediaInfo.kind == "audioinput" || mediaInfo.kind == "videoinput") {
assert_true(mediaInfo instanceof InputDeviceInfo);
} else if ( mediaInfo.kind == "audiooutput" ) {
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html 2020-07-15 21:59:16 UTC (rev 264427)
@@ -281,7 +281,55 @@
"currentTime does not skip ahead after pause");
}, "Tests that a media element with an assigned MediaStream does not advance currentTime while paused");
+promise_test(async t => {
+ const canvas = document.createElement("canvas");
+ const ctx = canvas.getContext("2d");
+ const stream = canvas.captureStream();
+ t.add_cleanup(() => {
+ vid.srcObject = null;
+ stream.getTracks().forEach(track => track.stop());
+ });
+ vid.srcObject = stream;
+ vid._ontimeupdate_ = () =>
+ assert_unreached("No timeupdate until potentially playing");
+
+ vid.play();
+
+ await new Promise(r => t.step_timeout(r, 1000));
+ assert_equals(vid.readyState, vid.HAVE_NOTHING,
+ "Video dimensions not known yet");
+
+ const start = performance.now();
+ ctx.fillStyle = "green";
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+
+ // Wait for, and check, potentially playing
+ await new Promise(r => vid._oncanplay_ = r);
+ const canplayDuration = (performance.now() - start) / 1000;
+ // "canplay" was just dispatched from a task queued when the element became
+ // potentially playing. currentTime may not have progressed more than the time
+ // it took from becoming potentially playing to starting the
+ // canplay-dispatching task. Though the media clock and the js clock may be
+ // different, so we take double this duration, or 100ms, whichever is greater,
+ // as a safety margin.
+ const margin = Math.max(0.1, canplayDuration * 2);
+ assert_between_inclusive(vid.currentTime, 0, margin,
+ "currentTime has not advanced more than twice it took to dispatch canplay");
+ assert_false(vid.paused, "Media element is not paused");
+ assert_false(vid.ended, "Media element is not ended");
+ assert_equals(vid.error, null,
+ "Media element playback has not stopped due to errors");
+ assert_greater_than(vid.readyState, vid.HAVE_CURRENT_DATA,
+ "Media element playback is not blocked");
+ // Unclear how to check for "paused for user interaction" and "paused for
+ // in-band content".
+
+ await new Promise(r => vid._ontimeupdate_ = r);
+ assert_between_exclusive(vid.currentTime, 0, 1,
+ "currentTime advances while potentially playing");
+}, "Tests that a media element with an assigned MediaStream does not start advancing currentTime until potentially playing");
+
promise_test(async t => {
const stream = await navigator.mediaDevices.getUserMedia({video: true});
t.add_cleanup(() => {
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https-expected.txt (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https-expected.txt 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https-expected.txt 2020-07-15 21:59:16 UTC (rev 264427)
@@ -21,4 +21,5 @@
PASS frameRate is reported by getSettings() for getUserMedia() video tracks
PASS facingMode is reported by getSettings() for getUserMedia() video tracks
FAIL resizeMode is reported by getSettings() for getUserMedia() video tracks assert_equals: resizeMode should exist and it should be a string. expected "string" but got "undefined"
+PASS Stopped tracks should expose deviceId/groupId
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-getSettings.https.html 2020-07-15 21:59:16 UTC (rev 264427)
@@ -197,4 +197,23 @@
"resizeMode should exist and it should be a string.");
assert_in_array(settings.resizeMode, ['none', 'crop-and-scale']);
}, 'resizeMode is reported by getSettings() for getUserMedia() video tracks');
+
+ promise_test(async t => {
+ const stream = await navigator.mediaDevices.getUserMedia({ audio: true, video : true});
+ const audioTrack = stream.getAudioTracks()[0];
+ const videoTrack = stream.getVideoTracks()[0];
+
+ const audioDeviceId = audioTrack.getSettings().deviceId;
+ const videoDeviceId = videoTrack.getSettings().deviceId;
+ const audioGroupId = audioTrack.getSettings().groupId;
+ const videoGroupId = videoTrack.getSettings().groupId;
+
+ audioTrack.stop();
+ videoTrack.stop();
+
+ assert_equals(audioTrack.getSettings().deviceId, audioDeviceId, "audio track deviceId");
+ assert_equals(videoTrack.getSettings().deviceId, videoDeviceId, "video track deviceId");
+ assert_equals(audioTrack.getSettings().groupId, audioGroupId, "audio track groupId");
+ assert_equals(videoTrack.getSettings().groupId, videoGroupId, "video track groupId");
+ }, 'Stopped tracks should expose deviceId/groupId');
</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrackEvent-constructor.https.html (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrackEvent-constructor.https.html 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrackEvent-constructor.https.html 2020-07-15 21:59:16 UTC (rev 264427)
@@ -6,25 +6,25 @@
<script>
test(function() {
assert_equals(MediaStreamTrackEvent.length, 2);
- assert_throws(new TypeError, function() {
+ assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type");
});
- assert_throws(new TypeError, function() {
+ assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", null);
});
- assert_throws(new TypeError, function() {
+ assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", undefined);
});
}, "The eventInitDict argument is required");
test(function() {
- assert_throws(new TypeError, function() {
+ assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", {});
});
- assert_throws(new TypeError, function() {
+ assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", { track: null });
});
- assert_throws(new TypeError, function() {
+ assert_throws_js(TypeError, function() {
new MediaStreamTrackEvent("type", { track: undefined });
});
}, "The eventInitDict's track member is required.");
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/historical.https.html (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/historical.https.html 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/historical.https.html 2020-07-15 21:59:16 UTC (rev 264427)
@@ -18,7 +18,7 @@
test(() => {
const mediaStream = new MediaStream();
- assert_throws(new TypeError(), () => URL.createObjectURL(mediaStream));
+ assert_throws_js(TypeError, () => URL.createObjectURL(mediaStream));
}, "Passing MediaStream to URL.createObjectURL() should throw");
test(() => {
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/idlharness.https.window.js (264426 => 264427)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/idlharness.https.window.js 2020-07-15 21:48:45 UTC (rev 264426)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/idlharness.https.window.js 2020-07-15 21:59:16 UTC (rev 264427)
@@ -1,5 +1,6 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
+// META: timeout=long
'use strict';