diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/media/tests/mochitest/test_getUserMedia_basicTabshare.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/media/tests/mochitest/test_getUserMedia_basicTabshare.html')
-rw-r--r-- | dom/media/tests/mochitest/test_getUserMedia_basicTabshare.html | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/dom/media/tests/mochitest/test_getUserMedia_basicTabshare.html b/dom/media/tests/mochitest/test_getUserMedia_basicTabshare.html new file mode 100644 index 000000000..c61b5c9b1 --- /dev/null +++ b/dom/media/tests/mochitest/test_getUserMedia_basicTabshare.html @@ -0,0 +1,70 @@ +<!DOCTYPE HTML> +<html> +<head> + <script type="application/javascript" src="mediaStreamPlayback.js"></script> +</head> +<body> +<pre id="test"> +<script type="application/javascript"> + createHTML({ + title: "getUserMedia Basic Tabshare Test", + bug: "1193075" + }); + /** + * Run a test to verify that we can complete a start and stop media playback + * cycle for a tabshare LocalMediaStream on a video HTMLMediaElement. + * + * Additionally, exercise applyConstraints code for tabshare viewport offset. + */ + 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"); + return; + } + var testVideo = createMediaElement('video', 'testVideo'); + + return Promise.resolve() + .then(() => getUserMedia({ + video: { mediaSource: "browser", + scrollWithPage: true }, + fake: false + })) + .then(stream => { + var playback = new LocalMediaStreamPlayback(testVideo, stream); + return playback.playMediaWithDeprecatedStreamStop(false); + }) + .then(() => getUserMedia({ + video: { + mediaSource: "browser", + viewportOffsetX: 0, + viewportOffsetY: 0, + viewportWidth: 100, + viewportHeight: 100 + }, + fake: false + })) + .then(stream => { + var playback = new LocalMediaStreamPlayback(testVideo, stream); + playback.startMedia(false); + return playback.verifyPlaying() + .then(() => Promise.all([ + () => testVideo.srcObject.getVideoTracks()[0].applyConstraints({ + mediaSource: "browser", + viewportOffsetX: 10, + viewportOffsetY: 50, + viewportWidth: 90, + viewportHeight: 50 + }), + () => listenUntil(testVideo, "resize", () => true) + ])) + .then(() => playback.verifyPlaying()) // still playing + .then(() => playback.deprecatedStopStreamInMediaPlayback()) + .then(() => playback.detachFromMediaElement()); + }); + }); + +</script> +</pre> +</body> +</html> |