OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <title>video controls play button always visible</title> | |
5 <script src="../resources/testharness.js"></script> | |
6 <script src="../resources/testharnessreport.js"></script> | |
7 <script src="media-controls.js"></script> | |
8 <style> | |
9 audio { | |
10 width: 24px; | |
11 } | |
12 </style> | |
13 </head> | |
14 <body onload="async_test(testPlayButtonVisible)"> | |
15 <video id="video" width="24px" controls></video> | |
16 <audio id="audio" controls></video> | |
17 <script> | |
18 function checkOneElement(test, id) { | |
19 var element = document.getElementById(id); | |
20 | |
21 // Check that the play button is shown. | |
22 var playButton = mediaControlsButton(element, "play-button"); | |
23 assert_true(getComputedStyle(playButton).display != "none", | |
24 "play button should not be hidden for " + id); | |
25 | |
26 // Also check for something that should be hidden, just to be sure | |
27 // that things are being recomputed properly before the test runs. | |
28 // This only works with the new media playback UI, since the old one | |
29 // doesn't hide anything based on width. | |
30 if (window.internals.runtimeFlags.newMediaPlaybackUiEnabled) { | |
31 var timeline = mediaControlsButton(element, "timeline"); | |
32 assert_true(getComputedStyle(timeline).display == "none", | |
33 "timeline should be hidden for " + id); | |
34 } | |
35 } | |
36 | |
37 function testPlayButtonVisible(test) { | |
38 checkOneElement(test, "video"); | |
39 checkOneElement(test, "audio"); | |
40 test.done(); | |
41 } | |
42 </script> | |
43 </video> | |
44 </body> | |
45 </html> | |
OLD | NEW |