[MediaStream] Update layout tests to newer spec.

https://bugs.webkit.org/show_bug.cgi?id=124985

Reviewed by Eric Carlson.

* TestExpectations:
* fast/mediastream/MediaStream-onended-expected.txt: Removed.
* fast/mediastream/MediaStreamTrack-onended-expected.txt: Added.
* fast/mediastream/MediaStreamTrack-onended.html: Renamed from LayoutTests/fast/mediastream/MediaStream-onended.html.
* fast/mediastream/RTCPeerConnection-ice-expected.txt:
* fast/mediastream/RTCPeerConnection-state-expected.txt:
* fast/mediastream/RTCSessionDescription-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5e2fce2c
2013-12-02 Lauro Neto <lauro.neto@openbossa.org>
[MediaStream] Update layout tests to newer spec.
https://bugs.webkit.org/show_bug.cgi?id=124985
Reviewed by Eric Carlson.
* TestExpectations:
* fast/mediastream/MediaStream-onended-expected.txt: Removed.
* fast/mediastream/MediaStreamTrack-onended-expected.txt: Added.
* fast/mediastream/MediaStreamTrack-onended.html: Renamed from LayoutTests/fast/mediastream/MediaStream-onended.html.
* fast/mediastream/RTCPeerConnection-ice-expected.txt:
* fast/mediastream/RTCPeerConnection-state-expected.txt:
* fast/mediastream/RTCSessionDescription-expected.txt:
2013-12-02 Chris Fleizach <cfleizach@apple.com>
AX: Crash at WebCore::commonTreeScope
......
......@@ -65,7 +65,3 @@ webkit.org/b/53990 fast/forms/search-event-delay.html [ Pass Failure ]
# No port in WebKit already support getMediaStream, so we are skipping those for now.
fast/mediastream/MediaStream-construct-with-ended-tracks.html [ Skip ]
fast/mediastream/MediaStream-clone.html [ Skip ]
# The spec is not clear if the MediaStream ended event should be fired if stop is called on each MediaStream's track
# Skipping it for now, then put it again when the spec decides it
fast/mediastream/MediaStream-onended.html [ Skip ]
Tests MediaStream::onended callback.
Tests MediaStreamTrack::onended callback.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS gotStream was called.
PASS stream.ended is false
PASS track.readyState == "ended" is false
PASS trackClone.readyState == "ended" is false
PASS streamEnded was called.
PASS stream.ended is true
PASS track.readyState == "ended" is true
PASS trackClone.readyState == "ended" is true
PASS gotStream2 was called.
PASS stream.ended is false
PASS track.readyState == "ended" is false
PASS trackClone.readyState == "ended" is false
PASS streamEnded2 was called.
PASS stream.ended is true
PASS track.readyState == "ended" is true
PASS trackClone.readyState == "ended" is true
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -7,7 +7,7 @@
<p id="description"></p>
<div id="console"></div>
<script>
description("Tests MediaStream::onended callback.");
description("Tests MediaStreamTrack::onended callback.");
function error() {
testFailed('Stream generation failed.');
......@@ -28,7 +28,8 @@
function streamEnded2() {
debug("");
testPassed('streamEnded2 was called.');
shouldBeTrue('stream.ended');
shouldBeTrue('track.readyState == "ended"');
shouldBeTrue('trackClone.readyState == "ended"');
finishJSTest();
}
......@@ -36,10 +37,13 @@
debug("");
testPassed('gotStream2 was called.');
stream = new webkitMediaStream(s);
shouldBeFalse('stream.ended');
track = stream.getAudioTracks()[0];
trackClone = track.clone();
shouldBeFalse('track.readyState == "ended"');
shouldBeFalse('trackClone.readyState == "ended"');
try {
stream.onended = streamEnded2;
stream.stop();
trackClone.onended = streamEnded2;
track.stop();
} catch (e) {
testFailed('MediaStream threw exception :' + e);
finishJSTest();
......@@ -49,7 +53,8 @@
function streamEnded() {
debug("");
testPassed('streamEnded was called.');
shouldBeTrue('stream.ended');
shouldBeTrue('track.readyState == "ended"');
shouldBeTrue('trackClone.readyState == "ended"');
getUserMedia({audio:true, video:true}, gotStream2);
}
......@@ -58,10 +63,15 @@
debug("");
testPassed('gotStream was called.');
stream = s;
shouldBeFalse('stream.ended');
// A second track is required as calling stop will not fire the ended
// event on the object it was called.
track = stream.getAudioTracks()[0];
trackClone = track.clone();
shouldBeFalse('track.readyState == "ended"');
shouldBeFalse('trackClone.readyState == "ended"');
try {
stream.onended = streamEnded;
stream.stop();
trackClone.onended = streamEnded;
track.stop();
} catch (e) {
testFailed('MediaStream threw exception :' + e);
finishJSTest();
......
......@@ -3,7 +3,7 @@ Tests the RTCPeerConnection Ice functionality.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS pc = new webkitRTCPeerConnection({iceServers:[]}, null); did not throw exception.
PASS pc = new webkitRTCPeerConnection({iceServers:[]}); did not throw exception.
PASS iceConnectionState is completed
PASS pc.addIceCandidate(null, null, null); threw exception TypeError: Type error.
PASS pc.addIceCandidate(iceCandidate, null, null); threw exception TypeError: Type error.
......
......@@ -3,7 +3,7 @@ Tests the RTCPeerConnection states.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS pc = new webkitRTCPeerConnection({iceServers:[]}, null); did not throw exception.
PASS pc = new webkitRTCPeerConnection({iceServers:[]}); did not throw exception.
PASS pc.signalingState is "stable"
PASS stateChanged was called
PASS pc.signalingState is "closed"
......
......@@ -11,9 +11,9 @@ PASS initializer = JSON.parse(JSON.stringify(sessionDescription)); did not throw
PASS sessionDescription = new RTCSessionDescription(initializer); did not throw exception.
PASS sessionDescription.type is "offer"
PASS sessionDescription.sdp is "foobar"
PASS new RTCSessionDescription(null); threw exception TypeError: Optional description init argument of RTCSessionDescription must be a valid Dictionary.
PASS new RTCSessionDescription(5); threw exception TypeError: Optional description init argument of RTCSessionDescription must be a valid Dictionary.
PASS new RTCSessionDescription('foobar'); threw exception TypeError: Optional description init argument of RTCSessionDescription must be a valid Dictionary.
PASS new RTCSessionDescription(null); threw exception TypeError: Optional RTCSessionDescription constructor argument must be a valid Dictionary.
PASS new RTCSessionDescription(5); threw exception TypeError: Optional RTCSessionDescription constructor argument must be a valid Dictionary.
PASS new RTCSessionDescription('foobar'); threw exception TypeError: Optional RTCSessionDescription constructor argument must be a valid Dictionary.
PASS new RTCSessionDescription({type:'foobar', sdp:'x'}); threw exception TypeError: Invalid RTCSessionDescription constructor arguments.
PASS new RTCSessionDescription({type:'offer', sdp:''}); threw exception TypeError: Invalid RTCSessionDescription constructor arguments.
PASS new RTCSessionDescription({}); did not throw exception.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment