gecko/dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html
2014-08-07 13:13:01 -04:00

61 lines
1.8 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=983504
-->
<head>
<meta charset="utf-8">
<title>mozGetUserMedia Basic Screenshare Test</title>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="head.js"></script>
<script type="application/javascript" src="mediaStreamPlayback.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=983504">mozGetUserMedia Basic Screenshare Test</a>
<p id="display"></p>
<div id="content" style="display: none">
<video id="testVideo"></video>
</div>
<pre id="test">
<script type="application/javascript">
/**
* Run a test to verify that we can complete a start and stop media playback
* cycle for an screenshare LocalMediaStream on a video HTMLMediaElement.
*/
SimpleTest.expectAssertions(0, 3); // Bug 1047842
runTest(function () {
const isWinXP = navigator.userAgent.indexOf("Windows NT 5.1") != -1;
if (IsMacOSX10_6orOlder() || isWinXP) {
ok(true, "Screensharing disabled for OSX10.6 and WinXP");
SimpleTest.finish();
return;
}
var testVideo = document.getElementById('testVideo');
var constraints = {
video: {
mozMediaSource: "screen",
mediaSource: "screen"
},
fake: false
};
getUserMedia(constraints, function (aStream) {
checkMediaStreamTracks(constraints, aStream);
var playback = new LocalMediaStreamPlayback(testVideo, aStream);
playback.playMediaWithStreamStop(false, function () {
aStream.stop();
SimpleTest.finish();
}, generateErrorCallback());
}, generateErrorCallback());
});
</script>
</pre>
</body>
</html>