summaryrefslogtreecommitdiffstats
path: root/dom/media/test/test_eme_canvas_blocked.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/media/test/test_eme_canvas_blocked.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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_eme_canvas_blocked.html')
-rw-r--r--dom/media/test/test_eme_canvas_blocked.html58
1 files changed, 58 insertions, 0 deletions
diff --git a/dom/media/test/test_eme_canvas_blocked.html b/dom/media/test/test_eme_canvas_blocked.html
new file mode 100644
index 000000000..e84b6db40
--- /dev/null
+++ b/dom/media/test/test_eme_canvas_blocked.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Test Encrypted Media Extensions</title>
+ <script type="text/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>
+ <script type="text/javascript" src="eme.js"></script>
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+var manager = new MediaTestManager;
+
+function startTest(test, token)
+{
+ manager.started(token);
+
+ var sessions = [];
+
+ var v = SetupEME(test, token);
+ v.preload = "auto"; // Required due to "canplay" not firing for MSE unless we do this.
+
+ v.addEventListener("loadeddata", function(ev) {
+ var video = ev.target;
+ var canvas = document.createElement("canvas");
+ canvas.width = video.videoWidth;
+ canvas.height = video.videoHeight;
+ document.body.appendChild(canvas);
+ var ctx = canvas.getContext("2d");
+ var threwError = false;
+ try {
+ ctx.drawImage(video, 0, 0);
+ } catch (ex) {
+ threwError = true;
+ }
+ ok(threwError, TimeStamp(token) + " - Should throw an error when trying to draw EME video to canvas.");
+ manager.finished(token);
+ });
+
+ LoadTestWithManagedLoadToken(test, v, manager, token,
+ { onlyLoadFirstFragments:2, noEndOfStream:false });
+}
+
+function beginTest() {
+ manager.runTests(gEMETests, startTest);
+}
+
+if (!IsMacOSSnowLeopardOrEarlier()) {
+ SimpleTest.waitForExplicitFinish();
+ SetupEMEPref(beginTest);
+} else {
+ todo(false, "Test disabled on this platform.");
+}
+</script>
+</pre>
+</body>
+</html>