summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/tests/mochitests/test_peerConnection_disabledVideoPreNegotiation.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/webrtc/tests/mochitests/test_peerConnection_disabledVideoPreNegotiation.html')
-rw-r--r--dom/media/webrtc/tests/mochitests/test_peerConnection_disabledVideoPreNegotiation.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/dom/media/webrtc/tests/mochitests/test_peerConnection_disabledVideoPreNegotiation.html b/dom/media/webrtc/tests/mochitests/test_peerConnection_disabledVideoPreNegotiation.html
new file mode 100644
index 0000000000..4c06de792e
--- /dev/null
+++ b/dom/media/webrtc/tests/mochitests/test_peerConnection_disabledVideoPreNegotiation.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <script type="application/javascript" src="pc.js"></script>
+ <script type="application/javascript" src="/tests/dom/canvas/test/captureStream_common.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+ createHTML({
+ bug: "1570673",
+ title: "Sending an initially disabled video track should be playable remotely",
+ visible: true,
+ });
+
+ var test;
+ runNetworkTest(async (options) => {
+ // [TODO] re-enable HW decoder after bug 1526207 is fixed.
+ if (navigator.userAgent.includes("Android")) {
+ await pushPrefs(["media.navigator.mediadatadecoder_vpx_enabled", false],
+ ["media.webrtc.hw.h264.enabled", false]);
+ }
+
+ test = new PeerConnectionTest(options);
+ test.setMediaConstraints([{video: true}], []);
+ test.chain.insertAfter("PC_LOCAL_GUM", function PC_LOCAL_DISABLE_VIDEO() {
+ for (const {track} of test.pcLocal._pc.getSenders()) {
+ if (track.kind == "video") {
+ track.enabled = false;
+ }
+ }
+ });
+ test.chain.append(async function PC_REMOTE_RECEIVING_BLACK() {
+ const v = test.pcRemote.remoteMediaElements[0];
+ is(v.readyState, v.HAVE_ENOUGH_DATA, "video element should be playing");
+ const h = new CaptureStreamTestHelper2D();
+ await h.waitForPixel(test.pcRemote.remoteMediaElements[0],
+ px => h.isPixel(px, h.black, 128));
+ });
+ await test.run();
+ });
+</script>
+</pre>
+</body>
+</html>