diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /dom/media/autoplay/test/mochitest/test_autoplay.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/autoplay/test/mochitest/test_autoplay.html')
-rw-r--r-- | dom/media/autoplay/test/mochitest/test_autoplay.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/dom/media/autoplay/test/mochitest/test_autoplay.html b/dom/media/autoplay/test/mochitest/test_autoplay.html new file mode 100644 index 0000000000..aa936f976d --- /dev/null +++ b/dom/media/autoplay/test/mochitest/test_autoplay.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Media test: autoplay attribute</title> + <script 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> +<video id='v1'"></video><audio id='a1'></audio> +<video id='v2' autoplay></video><audio id='a2' autoplay></audio> +<pre id="test"> +<script class="testbody" type="text/javascript"> +/* import-globals-from ../../../test/manifest.js */ +var v1 = document.getElementById('v1'); +var a1 = document.getElementById('a1'); +var v2 = document.getElementById('v2'); +var a2 = document.getElementById('a2'); +ok(!v1.autoplay, "v1.autoplay should be false by default"); +ok(!a1.autoplay, "v1.autoplay should be false by default"); +ok(v2.autoplay, "v2.autoplay should be true"); +ok(a2.autoplay, "v2.autoplay should be true"); + +v1.autoplay = true; +a1.autoplay = true; +ok(v1.autoplay, "video.autoplay not true"); +ok(a1.autoplay, "audio.autoplay not true"); +is(v1.getAttribute("autoplay"), "", "video autoplay attribute not set"); +is(a1.getAttribute("autoplay"), "", "video autoplay attribute not set"); + +mediaTestCleanup(); + +</script> +</pre> +</body> +</html> |