Bug 1349459 part 2 - test element as tainted when CreateImageBitmap() is used; r=jwwang
authorKaku Kuo <kaku@mozilla.com>
Wed, 22 Mar 2017 15:32:03 +0800
changeset 348775 4a8979c4c9df308fa51af4d198bb0ccf770cdede
parent 348774 f64ffac91054306beb892cd7102bb470fe620f0b
child 348776 ee30286771eb83c0878621485009dc2722daa78f
child 348852 20318a73395e89d3b2023735ec2bd9782e62d075
push id31535
push usercbook@mozilla.com
push dateWed, 22 Mar 2017 13:25:07 +0000
treeherdermozilla-central@ee30286771eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwwang
bugs1349459
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1349459 part 2 - test element as tainted when CreateImageBitmap() is used; r=jwwang MozReview-Commit-ID: 6zjugUsA4fZ
dom/media/test/mochitest.ini
dom/media/test/test_background_video_tainted_by_createimagebitmap.html
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -1147,16 +1147,19 @@ tags = suspend
 skip-if = toolkit == 'android' # android(bug 1304480)
 tags = suspend
 [test_background_video_suspend_ends.html]
 skip-if = toolkit == 'android' # bug 1295884, android(bug 1304480, bug 1232305)
 tags = suspend
 [test_background_video_tainted_by_capturestream.html]
 skip-if = toolkit == 'android' # bug 1346705
 tags = suspend
+[test_background_video_tainted_by_createimagebitmap.html]
+skip-if = toolkit == 'android' # bug 1346705
+tags = suspend
 [test_background_video_tainted_by_drawimage.html]
 skip-if = toolkit == 'android' # bug 1346705
 tags = suspend
 [test_background_video_drawimage_with_suspended_video.html]
 skip-if = toolkit == 'android' # bug 1346705
 tags = suspend
 
 [test_temporary_file_blob_video_plays.html]
new file mode 100644
--- /dev/null
+++ b/dom/media/test/test_background_video_tainted_by_createimagebitmap.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Test Background Video Is Tainted By createImageBitmap</title>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+<script src="manifest.js"></script>
+<script src="background_video.js"></script>
+<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
+<script type="text/javascript">
+"use strict";
+
+var manager = new MediaTestManager;
+
+startTest({
+  desc: 'Test Background Video Is Tainted By createImageBitmap',
+  prefs: [
+    [ "media.test.video-suspend", true ],
+    [ "media.suspend-bkgnd-video.enabled", true ],
+    [ "media.suspend-bkgnd-video.delay-ms", 1000 ]
+  ],
+  tests: gDecodeSuspendTests,
+  runTest: (test, token) => {
+    ok(true, `${test.name}`);
+    let v = appendVideoToDoc(test.name, token);
+    manager.started(token);
+
+    waitUntilPlaying(v)
+      .then(() => createImageBitmap(v))
+      .then(() => {
+        ok(v.hasSuspendTaint(), "Video is tainted after drawing to canvas");
+        return checkVideoDoesntSuspend(v);
+      })
+      .then(() => {
+        ok(true, 'Video ended before decode was suspended');
+        manager.finished(token);
+      })
+      .catch((e) => {
+        ok(false, 'Test failed: ' + e.toString());
+        manager.finished(token);
+      });
+  }
+});
+</script>
\ No newline at end of file