Changeset 215251 in webkit


Ignore:
Timestamp:
Apr 11, 2017 3:47:26 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Migrating webrtc tests to latest API
https://bugs.webkit.org/show_bug.cgi?id=170709

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-11
Reviewed by Eric Carlson.

  • webrtc/audio-peer-connection-webaudio.html:
  • webrtc/libwebrtc/descriptionGetters.html:
  • webrtc/negotiatedneeded-event-addStream.html:
  • webrtc/peer-connection-audio-mute.html:
  • webrtc/peer-connection-audio-mute2.html:
  • webrtc/peer-connection-remote-audio-mute.html:
  • webrtc/peer-connection-remote-audio-mute2.html:
  • webrtc/release-after-getting-track.html:
  • webrtc/video-disabled-black.html:
  • webrtc/video-mute.html:
  • webrtc/video-remote-mute.html:
  • webrtc/video-with-receiver.html:
  • webrtc/video.html:
Location:
trunk/LayoutTests
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r215239 r215251  
     12017-04-11  Youenn Fablet  <youenn@apple.com>
     2
     3        Migrating webrtc tests to latest API
     4        https://bugs.webkit.org/show_bug.cgi?id=170709
     5
     6        Reviewed by Eric Carlson.
     7
     8        * webrtc/audio-peer-connection-webaudio.html:
     9        * webrtc/libwebrtc/descriptionGetters.html:
     10        * webrtc/negotiatedneeded-event-addStream.html:
     11        * webrtc/peer-connection-audio-mute.html:
     12        * webrtc/peer-connection-audio-mute2.html:
     13        * webrtc/peer-connection-remote-audio-mute.html:
     14        * webrtc/peer-connection-remote-audio-mute2.html:
     15        * webrtc/release-after-getting-track.html:
     16        * webrtc/video-disabled-black.html:
     17        * webrtc/video-mute.html:
     18        * webrtc/video-remote-mute.html:
     19        * webrtc/video-with-receiver.html:
     20        * webrtc/video.html:
     21
    1222017-04-11  Youenn Fablet  <youenn@apple.com>
    223
  • trunk/LayoutTests/webrtc/audio-peer-connection-webaudio.html

    r215238 r215251  
    1515            return new Promise((resolve, reject) => {
    1616                createConnections((firstConnection) => {
    17                     firstConnection.addStream(stream);
     17                    firstConnection.addTrack(stream.getAudioTracks()[0], stream);
    1818                }, (secondConnection) => {
    19                     secondConnection.onaddstream = (streamEvent) => { resolve(streamEvent.stream); };
     19                    secondConnection.ontrack = (event) => { resolve(event.streams[0]); };
    2020                });
    2121                setTimeout(() => reject("Test timed out"), 5000);
  • trunk/LayoutTests/webrtc/libwebrtc/descriptionGetters.html

    r215238 r215251  
    1818     return navigator.mediaDevices.getUserMedia({ video: true}).then((stream) => {
    1919
    20         localConnection.addStream(stream);
     20        localConnection.addTrack(stream.getVideoTracks()[0], stream);
    2121        return localConnection.createOffer();
    2222    }).then((desc) => {
  • trunk/LayoutTests/webrtc/negotiatedneeded-event-addStream.html

    r215238 r215251  
    2121            var pc = new RTCPeerConnection();
    2222            pc.onnegotiationneeded = () => { resolve(); };
    23             pc.addStream(stream);
     23            pc.addTrack(stream.getVideoTracks()[0], stream);
    2424        });
    2525    });
     
    3434            var pc = new RTCPeerConnection();
    3535            pc.onnegotiationneeded = () => { reject(); };
    36             pc.addStream(stream);
     36            pc.addTrack(stream.getVideoTracks()[0], stream);
    3737            pc.close();
    3838            setTimeout(resolve, 500);
  • trunk/LayoutTests/webrtc/peer-connection-audio-mute.html

    r215238 r215251  
    2020            return new Promise((resolve, reject) => {
    2121                createConnections((firstConnection) => {
    22                     firstConnection.addStream(localStream);
     22                    firstConnection.addTrack(localTrack, localStream);
    2323                }, (secondConnection) => {
    24                     secondConnection.onaddstream = (streamEvent) => {
    25                         remoteStream = streamEvent.stream;
     24                    secondConnection.ontrack = (trackEvent) => {
     25                        remoteStream = trackEvent.streams[0];
    2626                        resolve();
    2727                    };
  • trunk/LayoutTests/webrtc/peer-connection-audio-mute2.html

    r215238 r215251  
    2020            return new Promise((resolve, reject) => {
    2121                createConnections((firstConnection) => {
    22                     firstConnection.addStream(localStream);
     22                    firstConnection.addTrack(localTrack);
    2323                }, (secondConnection) => {
    24                     secondConnection.onaddstream = (streamEvent) => {
    25                         remoteStream = streamEvent.stream;
     24                    secondConnection.ontrack = (trackEvent) => {
     25                        remoteStream = trackEvent.streams[0];
    2626                        resolve();
    2727                    };
  • trunk/LayoutTests/webrtc/peer-connection-remote-audio-mute.html

    r215238 r215251  
    1919            return new Promise((resolve, reject) => {
    2020                createConnections((firstConnection) => {
    21                     firstConnection.addStream(localStream);
     21                    firstConnection.addTrack(localStream.getAudioTracks()[0], localStream);
    2222                }, (secondConnection) => {
    23                     secondConnection.onaddstream = (streamEvent) => {
    24                         remoteStream = streamEvent.stream;
     23                    secondConnection.ontrack = (trackEvent) => {
     24                        remoteStream = trackEvent.streams[0];
    2525                        remoteTrack = remoteStream.getAudioTracks()[0];
    2626                        resolve();
  • trunk/LayoutTests/webrtc/peer-connection-remote-audio-mute2.html

    r215238 r215251  
    1919            return new Promise((resolve, reject) => {
    2020                createConnections((firstConnection) => {
    21                     firstConnection.addStream(localStream);
     21                    firstConnection.addTrack(localStream.getAudioTracks()[0]);
    2222                }, (secondConnection) => {
    23                     secondConnection.onaddstream = (streamEvent) => {
    24                         remoteStream = streamEvent.stream;
     23                    secondConnection.ontrack = (trackEvent) => {
     24                        remoteStream = trackEvent.streams[0];
    2525                        remoteTrack = remoteStream.getAudioTracks()[0];
    2626                        resolve();
  • trunk/LayoutTests/webrtc/release-after-getting-track.html

    r215238 r215251  
    1717        return new Promise((resolve, reject) => {
    1818            createConnections((firstConnection) => {
    19                 firstConnection.addStream(stream);
     19                firstConnection.addTrack(stream.getVideoTracks()[0], stream);
     20                firstConnection.addTrack(stream.getAudioTracks()[0], stream);
    2021            }, (secondConnection) => {
    2122                secondConnection.ontrack = resolve;
  • trunk/LayoutTests/webrtc/video-disabled-black.html

    r215238 r215251  
    5454            errorTest = reject;
    5555            createConnections((firstConnection) => {
    56                 firstConnection.addStream(stream);
     56                firstConnection.addTrack(stream.getVideoTracks()[0], stream);
    5757            }, (secondConnection) => {
    58                 secondConnection.onaddstream = (streamEvent) => { testStream(streamEvent.stream); };
     58                secondConnection.ontrack = (trackEvent) => { testStream(trackEvent.streams[0]); };
    5959            });
    6060        });
  • trunk/LayoutTests/webrtc/video-mute.html

    r215238 r215251  
    1414video = document.getElementById("video");
    1515canvas = document.getElementById("canvas");
    16 // FIXME: We should use tracks
    1716
    1817function isVideoBlack()
     
    4241
    4342            createConnections((firstConnection) => {
    44                 firstConnection.addStream(localStream);
     43                firstConnection.addTrack(track, localStream);
    4544            }, (secondConnection) => {
    46                 secondConnection.onaddstream = (streamEvent) => { resolve(streamEvent.stream); };
     45                secondConnection.ontrack = (trackEvent) => { resolve(trackEvent.streams[0]); };
    4746            });
    4847            setTimeout(() => reject("Test timed out"), 5000);
  • trunk/LayoutTests/webrtc/video-remote-mute.html

    r215238 r215251  
    1414video = document.getElementById("video");
    1515canvas = document.getElementById("canvas");
    16 // FIXME: We should use tracks
    1716
    1817function isVideoBlack()
     
    3938        return new Promise((resolve, reject) => {
    4039            createConnections((firstConnection) => {
    41                 firstConnection.addStream(localStream);
     40                firstConnection.addTrack(localStream.getVideoTracks()[0], localStream);
    4241            }, (secondConnection) => {
    43                 secondConnection.onaddstream = (streamEvent) => { resolve(streamEvent.stream); };
     42                secondConnection.ontrack = (trackEvent) => { resolve(trackEvent.streams[0]); };
    4443            });
    4544            setTimeout(() => reject("Test timed out"), 5000);
  • trunk/LayoutTests/webrtc/video-with-receiver.html

    r215238 r215251  
    4747        return new Promise((resolve, reject) => {
    4848            createConnections((firstConnection) => {
    49                 firstConnection.addStream(stream);
     49                firstConnection.addTrack(stream.getVideoTracks()[0], stream);
    5050            }, (secondConnection) => {
    5151                resolve(secondConnection.addTransceiver("video").receiver.track);
  • trunk/LayoutTests/webrtc/video.html

    r215238 r215251  
    4747        return new Promise((resolve, reject) => {
    4848            createConnections((firstConnection) => {
    49                 firstConnection.addStream(stream);
     49                var track = stream.getVideoTracks()[0];
     50                firstConnection.addTrack(stream.getVideoTracks()[0], stream);
    5051            }, (secondConnection) => {
    5152                secondConnection.ontrack = (trackEvent) => {
Note: See TracChangeset for help on using the changeset viewer.