blob: ca0ad0fd051237ef7f909a3f58f8b4bf39704e9b [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing UTF-8 content in SDP</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body>
<video id="video" autoplay=""></video>
<script src ="routines.js"></script>
<script>
promise_test(async (test) => {
if (!window.internals)
return Promise.reject("internals required");
const unicodeString = '世界你好';
const stream = await navigator.mediaDevices.getUserMedia({video: true});
internals.setMediaStreamTrackIdentifier(stream.getVideoTracks()[0], unicodeString);
const remoteStream = await new Promise((resolve, reject) => {
createConnections((firstConnection) => {
firstConnection.addTrack(stream.getVideoTracks()[0], stream);
}, (secondConnection) => {
secondConnection.ontrack = (trackEvent) => {
resolve(trackEvent.streams[0]);
};
});
setTimeout(() => reject("Test timed out"), 5000);
});
assert_equals(unicodeString, remoteStream.getVideoTracks()[0].id);
video.srcObject = remoteStream;
return video.play();
}, "Testing video exchange with UTF-8 track id");
</script>
</body>
</html>