| <!doctype html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <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) => { |
| const localStream = await navigator.mediaDevices.getUserMedia({video: {width:640, height:360 }}); |
| const localStream2 = localStream.clone(); |
| const stream = await new Promise((resolve, reject) => { |
| createConnections((firstConnection) => { |
| const sender = firstConnection.addTrack(localStream2.getVideoTracks()[0], localStream2); |
| }, (secondConnection) => { |
| secondConnection.ontrack = (trackEvent) => { |
| resolve(trackEvent.streams[0]); |
| }; |
| }); |
| setTimeout(() => reject("Test timed out"), 5000); |
| }); |
| |
| video.srcObject = stream; |
| await video.play(); |
| |
| assert_equals(video.videoWidth, 640); |
| assert_equals(video.videoHeight, 360); |
| }, "Ensure cloned track gets the expected width and height"); |
| </script> |
| </body> |
| </html> |