Auto merge of #23626 - servo-wpt-sync:wpt_update_24-06-2019, r=servo-wpt-sync

Sync WPT with upstream (24-06-2019)

Automated downstream sync of changes from upstream as of 24-06-2019.
[no-wpt-sync]

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23626)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-06-25 05:57:20 -04:00 committed by GitHub
commit f43af3c634
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 183 additions and 199 deletions

View file

@ -37,6 +37,3 @@
[Revoke blob URL after creating Request, will fetch] [Revoke blob URL after creating Request, will fetch]
expected: FAIL expected: FAIL
[Revoke blob URL after calling fetch, fetch should succeed]
expected: FAIL

View file

@ -387082,6 +387082,12 @@
{} {}
] ]
], ],
"shape-detection/detection-HTMLVideoElement-invalid-state.html": [
[
"shape-detection/detection-HTMLVideoElement-invalid-state.html",
{}
]
],
"shape-detection/detection-HTMLVideoElement.html": [ "shape-detection/detection-HTMLVideoElement.html": [
[ [
"shape-detection/detection-HTMLVideoElement.html", "shape-detection/detection-HTMLVideoElement.html",
@ -393930,6 +393936,12 @@
{} {}
] ]
], ],
"svg/scripted/script-runs-in-shadow-tree.html": [
[
"svg/scripted/script-runs-in-shadow-tree.html",
{}
]
],
"svg/scripted/text-attrs-dxdy-have-length.svg": [ "svg/scripted/text-attrs-dxdy-have-length.svg": [
[ [
"svg/scripted/text-attrs-dxdy-have-length.svg", "svg/scripted/text-attrs-dxdy-have-length.svg",
@ -661886,6 +661898,10 @@
"979efabdcb07cfdc0190383026a24e144dea1747", "979efabdcb07cfdc0190383026a24e144dea1747",
"testharness" "testharness"
], ],
"shape-detection/detection-HTMLVideoElement-invalid-state.html": [
"e777c96e4a1737968d60f390bf97d5f4c971e95d",
"testharness"
],
"shape-detection/detection-HTMLVideoElement.html": [ "shape-detection/detection-HTMLVideoElement.html": [
"7b3736d02e9b6b0769a18354b054e5c3ce268773", "7b3736d02e9b6b0769a18354b054e5c3ce268773",
"testharness" "testharness"
@ -661931,7 +661947,7 @@
"support" "support"
], ],
"shape-detection/shapedetection-cross-origin.sub.html": [ "shape-detection/shapedetection-cross-origin.sub.html": [
"c9d86430356de470bca7a8dfef8596e9159164ad", "f45369266973ee771c648d01b6e4a48ce1282959",
"testharness" "testharness"
], ],
"shape-detection/shapedetection-empty-input.html": [ "shape-detection/shapedetection-empty-input.html": [
@ -666386,6 +666402,10 @@
"786290a158b99a727bf26c4a30556246d30af8dc", "786290a158b99a727bf26c4a30556246d30af8dc",
"reftest" "reftest"
], ],
"svg/scripted/script-runs-in-shadow-tree.html": [
"d3a896fb93da55973f31fc574b13a6ad62bd1e94",
"testharness"
],
"svg/scripted/text-attrs-dxdy-have-length.svg": [ "svg/scripted/text-attrs-dxdy-have-length.svg": [
"a5f07e29a11ad0279b4645059f50573e76f909cc", "a5f07e29a11ad0279b4645059f50573e76f909cc",
"testharness" "testharness"
@ -678847,7 +678867,7 @@
"testharness" "testharness"
], ],
"webrtc-identity/RTCPeerConnection-peerIdentity.https.html": [ "webrtc-identity/RTCPeerConnection-peerIdentity.https.html": [
"518d57777aa79cd2c74ac1820f3538c4afb2732b", "f372e37a9a693ccf35597f47273d139f7f6b74a0",
"testharness" "testharness"
], ],
"webrtc-identity/identity-helper.sub.js": [ "webrtc-identity/identity-helper.sub.js": [
@ -679083,7 +679103,7 @@
"testharness" "testharness"
], ],
"webrtc/RTCPeerConnection-ontrack.https.html": [ "webrtc/RTCPeerConnection-ontrack.https.html": [
"10210129acd598fd959124fbe51462de8a1cdb0b", "99f30c264b3648d52fda6bb50de980bcbe84be3c",
"testharness" "testharness"
], ],
"webrtc/RTCPeerConnection-remote-track-mute.https.html": [ "webrtc/RTCPeerConnection-remote-track-mute.https.html": [
@ -681579,19 +681599,19 @@
"reftest" "reftest"
], ],
"webvtt/rendering/cues-with-video/processing-model/2_tracks-ref.html": [ "webvtt/rendering/cues-with-video/processing-model/2_tracks-ref.html": [
"1a46c4d83f8dab463739d1928c4fd87d4975f2bb", "fa969b1ab08ed393425c38b19b1b1f54a31e341c",
"support" "support"
], ],
"webvtt/rendering/cues-with-video/processing-model/2_tracks.html": [ "webvtt/rendering/cues-with-video/processing-model/2_tracks.html": [
"f422d73d6d767b4de5f296e9b67eb8072b0e43cc", "7648d876928dad228e3e84a2afa4a5ab8276773f",
"reftest" "reftest"
], ],
"webvtt/rendering/cues-with-video/processing-model/3_tracks-ref.html": [ "webvtt/rendering/cues-with-video/processing-model/3_tracks-ref.html": [
"bec3c0557ca557457f113c95a79cc3132899c373", "9fc52199fd01b5662e5db2a9a527a446bbe748cd",
"support" "support"
], ],
"webvtt/rendering/cues-with-video/processing-model/3_tracks.html": [ "webvtt/rendering/cues-with-video/processing-model/3_tracks.html": [
"809e173b46db0f2c3c65a708ad841703602c40f9", "c0d5c161cb918ee6738199f8b5220861b0401805",
"reftest" "reftest"
], ],
"webvtt/rendering/cues-with-video/processing-model/align_center-ref.html": [ "webvtt/rendering/cues-with-video/processing-model/align_center-ref.html": [

View file

@ -56,9 +56,6 @@
[outline-width length(px) / values] [outline-width length(px) / values]
expected: FAIL expected: FAIL
[border-left-width length(em) / values]
expected: FAIL
[border-bottom-width length(px) / values] [border-bottom-width length(px) / values]
expected: FAIL expected: FAIL
@ -92,12 +89,6 @@
[min-width length(px) / values] [min-width length(px) / values]
expected: FAIL expected: FAIL
[border-top-color color(rgba) / values]
expected: FAIL
[border-right-color color(rgba) / values]
expected: FAIL
[font-size length(ex) / values] [font-size length(ex) / values]
expected: FAIL expected: FAIL
@ -128,9 +119,6 @@
[font-size length(em) / values] [font-size length(em) / values]
expected: FAIL expected: FAIL
[border-left-width length(mm) / values]
expected: FAIL
[vertical-align length(em) / values] [vertical-align length(em) / values]
expected: FAIL expected: FAIL
@ -212,9 +200,6 @@
[letter-spacing length(in) / values] [letter-spacing length(in) / values]
expected: FAIL expected: FAIL
[border-bottom-color color(rgba) / values]
expected: FAIL
[min-width percentage(%) / values] [min-width percentage(%) / values]
expected: FAIL expected: FAIL
@ -233,9 +218,6 @@
[vertical-align length(pt) / values] [vertical-align length(pt) / values]
expected: FAIL expected: FAIL
[border-left-color color(rgba) / values]
expected: FAIL
[letter-spacing length(pc) / values] [letter-spacing length(pc) / values]
expected: FAIL expected: FAIL
@ -302,15 +284,9 @@
[border-top-width length(pc) / values] [border-top-width length(pc) / values]
expected: FAIL expected: FAIL
[border-left-width length(px) / values]
expected: FAIL
[font-size length(px) / values] [font-size length(px) / values]
expected: FAIL expected: FAIL
[border-left-width length(cm) / values]
expected: FAIL
[border-right-width length(px) / values] [border-right-width length(px) / values]
expected: FAIL expected: FAIL
@ -332,9 +308,6 @@
[border-right-width length(pt) / values] [border-right-width length(pt) / values]
expected: FAIL expected: FAIL
[border-left-width length(in) / values]
expected: FAIL
[max-height length(in) / values] [max-height length(in) / values]
expected: FAIL expected: FAIL
@ -365,15 +338,9 @@
[letter-spacing length(ex) / values] [letter-spacing length(ex) / values]
expected: FAIL expected: FAIL
[border-left-width length(ex) / values]
expected: FAIL
[outline-width length(mm) / values] [outline-width length(mm) / values]
expected: FAIL expected: FAIL
[border-left-width length(pc) / values]
expected: FAIL
[outline-width length(pc) / values] [outline-width length(pc) / values]
expected: FAIL expected: FAIL
@ -428,9 +395,6 @@
[z-index integer(integer) / values] [z-index integer(integer) / values]
expected: FAIL expected: FAIL
[border-left-width length(pt) / values]
expected: FAIL
[vertical-align length(mm) / values] [vertical-align length(mm) / values]
expected: FAIL expected: FAIL

View file

@ -1,2 +0,0 @@
[matchMedia-display-none-iframe.html]
expected: ERROR

View file

@ -84,9 +84,6 @@
[Request: combined response Content-Type: text/html text/plain] [Request: combined response Content-Type: text/html text/plain]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/plain */*]
expected: FAIL
[<iframe>: combined response Content-Type: text/plain;charset=gbk text/html;charset=windows-1254] [<iframe>: combined response Content-Type: text/plain;charset=gbk text/html;charset=windows-1254]
expected: FAIL expected: FAIL
@ -306,9 +303,6 @@
[Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK]
expected: NOTRUN expected: NOTRUN
[<iframe>: separate response Content-Type: text/plain */*;charset=gbk]
expected: FAIL
[<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html] [<iframe>: combined response Content-Type: text/html;charset=gbk text/plain text/html]
expected: FAIL expected: FAIL
@ -321,15 +315,12 @@
[<iframe>: separate response Content-Type: */* text/html] [<iframe>: separate response Content-Type: */* text/html]
expected: FAIL expected: FAIL
[<iframe>: separate response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;" \\" text/plain]
expected: FAIL
[<iframe>: combined response Content-Type: text/html */*;charset=gbk] [<iframe>: combined response Content-Type: text/html */*;charset=gbk]
expected: FAIL expected: FAIL
[<iframe>: combined response Content-Type: text/html;" \\" text/plain] [<iframe>: combined response Content-Type: text/html;" text/plain]
expected: FAIL
[<iframe>: separate response Content-Type: text/html;x=" text/plain]
expected: FAIL expected: FAIL

View file

@ -56,9 +56,6 @@
[separate text/javascript x/x] [separate text/javascript x/x]
expected: FAIL expected: FAIL
[separate text/javascript;charset=windows-1252 error text/javascript]
expected: FAIL
[separate text/javascript ] [separate text/javascript ]
expected: FAIL expected: FAIL

View file

@ -11,6 +11,3 @@
[X-Content-Type-Options%3A%20nosniff%0C] [X-Content-Type-Options%3A%20nosniff%0C]
expected: FAIL expected: FAIL
[X-Content-Type-Options%3A%20'NosniFF']
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_1.html]
[Multiple history traversals from the same task]
expected: FAIL

View file

@ -1,4 +0,0 @@
[traverse_the_history_3.html]
[Multiple history traversals, last would be aborted]
expected: FAIL

View file

@ -1,4 +1,4 @@
[traverse_the_history_2.html] [traverse_the_history_5.html]
[Multiple history traversals, last would be aborted] [Multiple history traversals, last would be aborted]
expected: FAIL expected: FAIL

View file

@ -1,4 +1,5 @@
[sharedworker-in-worker.html] [sharedworker-in-worker.html]
expected: ERROR
[Base URL in workers: new SharedWorker()] [Base URL in workers: new SharedWorker()]
expected: FAIL expected: FAIL

View file

@ -1,5 +1,4 @@
[005.html] [005.html]
expected: ERROR
[dedicated worker in shared worker in dedicated worker] [dedicated worker in shared worker in dedicated worker]
expected: FAIL expected: FAIL

View file

@ -0,0 +1,50 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const videoElementTests =
[
{
createDetector: () => { return new FaceDetector(); },
name: "Face - detect(HTMLVideoElement)",
},
{
createDetector: () => { return new BarcodeDetector(); },
name: "Barcode - detect(HTMLVideoElement)",
}
];
for (let videoElementTest of videoElementTests) {
// Detector's detect() rejects on a HAVE_NOTHING HTMLVideoElement.
promise_test(async t => {
const video = document.createElement("video");
video.src = "";
const videoWatcher = new EventWatcher(t, video, ["play", "error"]);
video.load();
await videoWatcher.wait_for("error");
assert_equals(video.readyState, video.HAVE_NOTHING);
const detector = videoElementTest.createDetector();
await promise_rejects(t, 'InvalidStateError', detector.detect(video));
}, `${videoElementTest.name} - HAVE_NOTHING`);
// Detector's detect() rejects on a HAVE_METADATA HTMLVideoElement.
promise_test(async t => {
const video = document.createElement("video");
video.src = "/media/white.webm";
video.loop = true;
video.autoplay = true;
const videoWatcher = new EventWatcher(t, video, ["loadedmetadata", "error"]);
video.load();
await videoWatcher.wait_for("loadedmetadata");
assert_equals(video.readyState, video.HAVE_METADATA);
const detector = videoElementTest.createDetector();
await promise_rejects(t, 'InvalidStateError', detector.detect(video));
}, `${videoElementTest.name} - HAVE_METADATA`);
}
</script>

View file

@ -30,9 +30,9 @@ for (let crossOriginTest of crossOriginTests) {
img.src = IMAGE_URL; img.src = IMAGE_URL;
await imgWatcher.wait_for("load"); await imgWatcher.wait_for("load");
const detector = crossOriginTest.createDetector(); const detector = crossOriginTest.createDetector();
promise_rejects(t, "SecurityError", detector.detect(img)); await promise_rejects(t, "SecurityError", detector.detect(img));
}, crossOriginTest.detectorType }, `${crossOriginTest.detectorType} should reject cross-origin \
+ " should reject cross-origin HTMLImageElements with a SecurityError."); HTMLImageElements with a SecurityError.`);
// Verifies that Detector rejects a cross-origin ImageBitmap. // Verifies that Detector rejects a cross-origin ImageBitmap.
promise_test(async t => { promise_test(async t => {
@ -42,9 +42,9 @@ for (let crossOriginTest of crossOriginTests) {
await imgWatcher.wait_for("load"); await imgWatcher.wait_for("load");
const imgBitmap = await createImageBitmap(img); const imgBitmap = await createImageBitmap(img);
const detector = crossOriginTest.createDetector(); const detector = crossOriginTest.createDetector();
promise_rejects(t, "SecurityError", detector.detect(imgBitmap)); await promise_rejects(t, "SecurityError", detector.detect(imgBitmap));
}, crossOriginTest.detectorType }, `${crossOriginTest.detectorType} should reject cross-origin \
+ " should reject cross-origin ImageBitmaps with a SecurityError."); ImageBitmaps with a SecurityError.`);
// Verifies that Detector rejects a cross-origin HTMLVideoElement. // Verifies that Detector rejects a cross-origin HTMLVideoElement.
promise_test(async t => { promise_test(async t => {
@ -53,9 +53,22 @@ for (let crossOriginTest of crossOriginTests) {
video.src = VIDEO_URL; video.src = VIDEO_URL;
await videoWatcher.wait_for("loadeddata"); await videoWatcher.wait_for("loadeddata");
const detector = crossOriginTest.createDetector(); const detector = crossOriginTest.createDetector();
promise_rejects(t, "SecurityError", detector.detect(video)); await promise_rejects(t, "SecurityError", detector.detect(video));
}, crossOriginTest.detectorType }, `${crossOriginTest.detectorType} should reject cross-origin \
+ " should reject cross-origin HTMLVideoElements with a SecurityError."); HTMLVideoElements with a SecurityError.`);
// Verifies that Detector rejects a cross-origin HTMLCanvasElement.
promise_test(async t => {
const img = new Image();
const imgWatcher = new EventWatcher(t, img, ["load", "error"]);
img.src = IMAGE_URL;
await imgWatcher.wait_for("load");
const canvas = document.createElement("canvas");
canvas.getContext("2d").drawImage(img, 0, 0);
const detector = crossOriginTest.createDetector();
await promise_rejects(t, "SecurityError", detector.detect(canvas));
}, `${crossOriginTest.detectorType} should reject cross-origin \
HTMLCanvasElement with a SecurityError.`);
} }

View file

@ -0,0 +1,12 @@
<!doctype html>
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
<link rel="author" href="https://mozilla.org" title="Mozilla">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1555949">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="host"></div>
<script>
let svgScript = document.createElementNS("http://www.w3.org/2000/svg", "script");
svgScript.innerHTML = `test(function() {}, "svg:script runs correctly in a shadow tree");`;
document.getElementById("host").attachShadow({ mode: "open" }).appendChild(svgScript);
</script>

View file

@ -78,15 +78,6 @@
`Expect validated identity from mock-idp.js to be same as specified in usernameHint`); `Expect validated identity from mock-idp.js to be same as specified in usernameHint`);
}, 'setRemoteDescription() on offer with a=identity should establish peerIdentity'); }, 'setRemoteDescription() on offer with a=identity should establish peerIdentity');
/*
If the peerIdentity configuration is applied to the RTCPeerConnection, this
establishes a target peer identity of the provided value. Alternatively, if the
RTCPeerConnection has previously authenticated the identity of the peer (that
is, the peerIdentity promise is resolved), then this also establishes a
target peer identity.
The target peer identity cannot be changed once set.
*/
promise_test(async t => { promise_test(async t => {
const port = window.location.port; const port = window.location.port;
const [idpDomain] = getIdpDomains(); const [idpDomain] = getIdpDomains();
@ -112,16 +103,11 @@
const offer = await pc1.createOffer(); const offer = await pc1.createOffer();
try { await promise_rejects(t, 'OperationError',
await pc2.setRemoteDescription(offer); pc2.setRemoteDescription(offer));
assert_true(false, "Previous line (sRD) should have thrown!"); await promise_rejects(t, 'OperationError',
} catch (e) { pc2.peerIdentity);
assert_equals(e.name, 'InvalidModificationError'); }, 'setRemoteDescription() on offer with a=identity that resolve to value different from target peer identity should reject with OperationError');
}
assert_true(pc2.signalingState, 'closed',
'Expect peer connection to be closed after mismatch peer identity');
}, 'setRemoteDescription() on offer with a=identity that resolve to value different from target peer identity should reject with InvalidModificationError');
/* /*
9.4. Verifying Identity Assertions 9.4. Verifying Identity Assertions

View file

@ -95,7 +95,7 @@
// tests that ontrack is called and parses the msid information from the SDP and creates // tests that ontrack is called and parses the msid information from the SDP and creates
// the streams with matching identifiers. // the streams with matching identifiers.
async_test(t => { promise_test(async t => {
const pc = new RTCPeerConnection(); const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close()); t.add_cleanup(() => pc.close());
@ -123,34 +123,28 @@ a=msid:stream1 track1
a=ssrc:1001 cname:some a=ssrc:1001 cname:some
`; `;
pc.ontrack = t.step_func(trackEvent => { const trackEventPromise = addEventListenerPromise(t, pc, 'track');
const { streams, track, transceiver } = trackEvent; await pc.setRemoteDescription({ type: 'offer', sdp });
const trackEvent = await trackEventPromise;
const { streams, track, transceiver } = trackEvent;
assert_equals(streams.length, 1, assert_equals(streams.length, 1,
'the track belongs to one MediaStream'); 'the track belongs to one MediaStream');
const [stream] = streams; const [stream] = streams;
assert_equals(stream.id, 'stream1', assert_equals(stream.id, 'stream1',
'Expect stream.id to be the same as specified in the a=msid line'); 'Expect stream.id to be the same as specified in the a=msid line');
assert_equals(track.kind, 'audio', assert_equals(track.kind, 'audio',
'Expect track.kind to be audio'); 'Expect track.kind to be audio');
validateTrackEvent(trackEvent); validateTrackEvent(trackEvent);
assert_equals(transceiver.direction, 'recvonly', assert_equals(transceiver.direction, 'recvonly',
'Expect transceiver.direction to be reverse of sendonly (recvonly)'); 'Expect transceiver.direction to be reverse of sendonly (recvonly)');
t.done();
});
pc.setRemoteDescription({ type: 'offer', sdp })
.catch(t.step_func(err => {
assert_unreached('Error ' + err.name + ': ' + err.message);
}));
}, 'setRemoteDescription should trigger ontrack event when the MSID of the stream is is parsed.'); }, 'setRemoteDescription should trigger ontrack event when the MSID of the stream is is parsed.');
async_test(t => { promise_test(async t => {
const pc = new RTCPeerConnection(); const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close()); t.add_cleanup(() => pc.close());
@ -179,101 +173,61 @@ a=ssrc:1001 cname:some
pc.ontrack = t.unreached_func('ontrack event should not fire for track with recvonly direction'); pc.ontrack = t.unreached_func('ontrack event should not fire for track with recvonly direction');
pc.setRemoteDescription({ type: 'offer', sdp }) await pc.setRemoteDescription({ type: 'offer', sdp });
.catch(t.step_func(err => { await new Promise(resolve => t.step_timeout(resolve, 100));
assert_unreached('Error ' + err.name + ': ' + err.message);
}))
.then(t.step_func(() => {
t.step_timeout(t.step_func_done(), 100);
}));
}, 'setRemoteDescription() with m= line of recvonly direction should not trigger track event'); }, 'setRemoteDescription() with m= line of recvonly direction should not trigger track event');
async_test(t => { promise_test(async t => {
const pc1 = new RTCPeerConnection(); const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close()); t.add_cleanup(() => pc1.close());
const pc2 = new RTCPeerConnection(); const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc2.close()); t.add_cleanup(() => pc2.close());
pc2.ontrack = t.step_func(trackEvent => { const [track, mediaStream] = await getTrackFromUserMedia('audio');
const { track } = trackEvent; pc1.addTrack(track, mediaStream);
const trackEventPromise = addEventListenerPromise(t, pc2, 'track');
await pc2.setRemoteDescription(await pc1.createOffer());
const trackEvent = await trackEventPromise;
assert_equals(track.kind, 'audio', assert_equals(trackEvent.track.kind, 'audio',
'Expect track.kind to be audio'); 'Expect track.kind to be audio');
validateTrackEvent(trackEvent); validateTrackEvent(trackEvent);
t.done();
});
return getTrackFromUserMedia('audio')
.then(([track, mediaStream]) => {
pc1.addTrack(track, mediaStream);
return pc1.createOffer()
.then(offer => pc2.setRemoteDescription(offer));
})
.catch(t.step_func(err => {
assert_unreached('Error ' + err.name + ': ' + err.message);
}));
}, 'addTrack() should cause remote connection to fire ontrack when setRemoteDescription()'); }, 'addTrack() should cause remote connection to fire ontrack when setRemoteDescription()');
async_test(t => { promise_test(async t => {
const pc1 = new RTCPeerConnection(); const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close()); t.add_cleanup(() => pc1.close());
const pc2 = new RTCPeerConnection(); const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc2.close()); t.add_cleanup(() => pc2.close());
pc2.ontrack = t.step_func(trackEvent => {
const { track } = trackEvent;
assert_equals(track.kind, 'video',
'Expect track.kind to be video');
validateTrackEvent(trackEvent);
t.done();
});
pc1.addTransceiver('video'); pc1.addTransceiver('video');
return pc1.createOffer() const trackEventPromise = addEventListenerPromise(t, pc2, 'track');
.then(offer => pc2.setRemoteDescription(offer)) await pc2.setRemoteDescription(await pc1.createOffer());
.catch(t.step_func(err => { const trackEvent = await trackEventPromise;
assert_unreached('Error ' + err.name + ': ' + err.message); const { track } = trackEvent;
}));
assert_equals(track.kind, 'video',
'Expect track.kind to be video');
validateTrackEvent(trackEvent);
}, `addTransceiver('video') should cause remote connection to fire ontrack when setRemoteDescription()`); }, `addTransceiver('video') should cause remote connection to fire ontrack when setRemoteDescription()`);
async_test(t => { promise_test(async t => {
const pc1 = new RTCPeerConnection(); const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close()); t.add_cleanup(() => pc1.close());
const pc2 = new RTCPeerConnection(); const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc2.close()); t.add_cleanup(() => pc2.close());
pc2.ontrack = t.step_func(trackEvent => {
const { track } = trackEvent;
assert_equals(track.kind, 'video',
'Expect track.kind to be video');
validateTrackEvent(trackEvent);
t.done();
});
pc1.addTransceiver('audio', { direction: 'inactive' }); pc1.addTransceiver('audio', { direction: 'inactive' });
pc2.ontrack = t.unreached_func('ontrack event should not fire for track with inactive direction'); pc2.ontrack = t.unreached_func('ontrack event should not fire for track with inactive direction');
return pc1.createOffer() await pc2.setRemoteDescription(await pc1.createOffer());
.then(offer => pc2.setRemoteDescription(offer)) await new Promise(resolve => t.step_timeout(resolve, 100));
.catch(t.step_func(err => {
assert_unreached('Error ' + err.name + ': ' + err.message);
}))
.then(t.step_func(() => {
t.step_timeout(t.step_func_done(), 100);
}));
}, `addTransceiver() with inactive direction should not cause remote connection to fire ontrack when setRemoteDescription()`); }, `addTransceiver() with inactive direction should not cause remote connection to fire ontrack when setRemoteDescription()`);
</script> </script>

View file

@ -18,9 +18,9 @@ body { margin:0 }
left: 0; left: 0;
right: 0; right: 0;
text-align: center; text-align: center;
font-family: sans-serif;
} }
.cue > span { .cueText {
font-family: Ahem, sans-serif;
background: rgba(0,0,0,0.8); background: rgba(0,0,0,0.8);
color: white; color: white;
} }
@ -30,6 +30,9 @@ body { margin:0 }
<source src="/media/white.webm" type="video/webm"> <source src="/media/white.webm" type="video/webm">
<source src="/media/white.mp4" type="video/mp4"> <source src="/media/white.mp4" type="video/mp4">
</video> </video>
<span class="cue"><span>This is a <u>test subtitle</u><br>This is a test subtitle</span></span> <span class="cue">
<div><span class="cueText">This is a <u>test subtitle</u></span></div>
<div><span class="cueText">This is a test subtitle</span></div>
</span>
</div> </div>
</html> </html>

View file

@ -5,6 +5,9 @@
<style> <style>
html { overflow:hidden } html { overflow:hidden }
body { margin:0 } body { margin:0 }
::cue {
font-family: Ahem, sans-serif;
}
</style> </style>
<script src="/common/reftest-wait.js"></script> <script src="/common/reftest-wait.js"></script>
<video width="320" height="180" autoplay onplaying="this.onplaying = null; this.pause(); takeScreenshot();"> <video width="320" height="180" autoplay onplaying="this.onplaying = null; this.pause(); takeScreenshot();">

View file

@ -18,9 +18,9 @@ body { margin:0 }
left: 0; left: 0;
right: 0; right: 0;
text-align: center; text-align: center;
font-family: sans-serif;
} }
.cue > span { .cueText {
font-family: Ahem, sans-serif;
background: rgba(0,0,0,0.8); background: rgba(0,0,0,0.8);
color: white; color: white;
} }
@ -30,6 +30,10 @@ body { margin:0 }
<source src="/media/white.webm" type="video/webm"> <source src="/media/white.webm" type="video/webm">
<source src="/media/white.mp4" type="video/mp4"> <source src="/media/white.mp4" type="video/mp4">
</video> </video>
<span class="cue"><span>This is a <b>test subtitle</b><br>This is a <u>test subtitle</u><br>This is a test subtitle</span></span> <span class="cue">
<div><span class="cueText">This is a <b>test subtitle</b></span></div>
<div><span class="cueText">This is a <u>test subtitle</u></span></div>
<div><span class="cueText">This is a test subtitle</span></div>
</span>
</div> </div>
</html> </html>

View file

@ -5,6 +5,9 @@
<style> <style>
html { overflow:hidden } html { overflow:hidden }
body { margin:0 } body { margin:0 }
::cue {
font-family: Ahem, sans-serif;
}
</style> </style>
<script src="/common/reftest-wait.js"></script> <script src="/common/reftest-wait.js"></script>
<video width="320" height="180" autoplay onplaying="this.onplaying = null; this.pause(); takeScreenshot();"> <video width="320" height="180" autoplay onplaying="this.onplaying = null; this.pause(); takeScreenshot();">