Index: LayoutTests/fast/mediastream/MediaStreamTrack-getSourceInfos.html |
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-onnegotiationneeded.html b/LayoutTests/fast/mediastream/MediaStreamTrack-getSourceInfos.html |
similarity index 47% |
copy from LayoutTests/fast/mediastream/RTCPeerConnection-onnegotiationneeded.html |
copy to LayoutTests/fast/mediastream/MediaStreamTrack-getSourceInfos.html |
index d8e8df10d8dea80b4bba3bbc69cf956bb633a3f8..a4f7ad1229df0aa98080178acfc7abadf32534eb 100644 |
--- a/LayoutTests/fast/mediastream/RTCPeerConnection-onnegotiationneeded.html |
+++ b/LayoutTests/fast/mediastream/MediaStreamTrack-getSourceInfos.html |
@@ -1,44 +1,43 @@ |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
<html> |
<head> |
+<link rel="stylesheet" href="../js/resources/js-test-style.css"> |
<script src="../js/resources/js-test-pre.js"></script> |
</head> |
<body> |
+<p id="description"></p> |
+<div id="console"></div> |
<script> |
-description("Tests RTCPeerConnection onnegotiationneeded."); |
+description("Tests MediaStreamTrack::getSourceInfos."); |
-var stream = null; |
-var pc = null; |
+var sources = null; |
+var previousId; |
function error() { |
testFailed('Stream generation failed.'); |
finishJSTest(); |
} |
-function getUserMedia(dictionary, callback) { |
+function getUserMedia(constraints, callback) { |
try { |
- navigator.webkitGetUserMedia(dictionary, callback, error); |
+ navigator.webkitGetUserMedia(constraints, callback, error); |
} catch (e) { |
testFailed('webkitGetUserMedia threw exception :' + e); |
finishJSTest(); |
} |
} |
-function onNegotiationNeeded(event) { |
- testPassed('onNegotiationNeeded was called.'); |
- |
+function gotStream(s) { |
+ shouldNotThrow('sources = MediaStreamTrack.getSourceInfos();'); |
+ shouldBeTrue('sources.length > 0'); |
+ shouldBeTrue('sources[0].id === previousId'); |
+ shouldBeTrue('sources[0].label.length > 0'); |
finishJSTest(); |
} |
-function gotStream(s) { |
- testPassed('Got a stream.'); |
- stream = s; |
- |
- pc = new webkitRTCPeerConnection(null, null); |
- pc.onnegotiationneeded = onNegotiationNeeded; |
- |
- pc.addStream(stream); |
-} |
+shouldNotThrow('sources = MediaStreamTrack.getSourceInfos();'); |
+shouldBeTrue('sources.length > 0'); |
+previousId = sources[0].id; |
getUserMedia({audio:true, video:true}, gotStream); |