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/test/test_streams_capture_origin.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/test/test_streams_capture_origin.html')
-rw-r--r-- | dom/media/test/test_streams_capture_origin.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/media/test/test_streams_capture_origin.html b/dom/media/test/test_streams_capture_origin.html new file mode 100644 index 000000000..916163e9c --- /dev/null +++ b/dom/media/test/test_streams_capture_origin.html @@ -0,0 +1,47 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test for Bug 1189506</title> + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> + <script type="text/javascript" src="manifest.js"></script> +</head> +<body> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1189506">Mozilla Bug 1189506</a> +<p id="display"></p> +<video id="vin"></video> +<video id="vout" style="position:absolute; top:0; left:0"></video> +<canvas id="c"></canvas> +<div id="content" style="display: none"> +</div> +<pre id="test"> +<script type="application/javascript"> + +/** Test for Bug 1189506 **/ + +SimpleTest.waitForExplicitFinish(); + +var resource = getPlayableVideo(gSmallTests).name; + +vin.src = "http://example.org:8000/tests/dom/media/test/" + resource; +vin.preload = "metadata"; + +vin.onloadedmetadata = function () { + vout.srcObject = vin.mozCaptureStreamUntilEnded(); + vin.play(); + vout.play(); +}; + +vout.onended = function() { + var ctx = SpecialPowers.wrap(c.getContext("2d")); + ctx.drawWindow(window, 0, 0, 10, 10, "rgb(255, 255, 0)", 0); + var data = ctx.getImageData(2, 2, 1, 1); + // Captured cross-origin video streams should render entirely black. + is(data.data.join(','), "0,0,0,255", "expected black"); + vout.style.position = ""; + SimpleTest.finish(); +}; +</script> +</pre> +</body> +</html> |