OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Test that the overlay play button respects the controls attribute
</title> |
| 5 <script src="media-controls.js"></script> |
| 6 <script src="media-file.js"></script> |
| 7 <script src="video-test.js"></script> |
| 8 <script> |
| 9 function start() |
| 10 { |
| 11 window.internals.settings.setMediaControlsOverlayPlayButtonEnabl
ed(true); |
| 12 |
| 13 findMediaElement(); |
| 14 |
| 15 video.controls = true; |
| 16 |
| 17 button = mediaControlsButton(video, 'overlay-play-button') |
| 18 testExpected('getComputedStyle(button).display', 'flex'); |
| 19 |
| 20 waitForEventOnce('loadeddata', loadeddata); |
| 21 video.src = findMediaFile('video', 'content/test'); |
| 22 } |
| 23 |
| 24 function loadeddata() |
| 25 { |
| 26 waitForEventOnce('play', play1); |
| 27 run('video.play()'); |
| 28 } |
| 29 |
| 30 function play1() |
| 31 { |
| 32 testExpected('getComputedStyle(button).display', 'none'); |
| 33 |
| 34 waitForEventOnce('pause', pause1); |
| 35 run('video.pause()'); |
| 36 } |
| 37 |
| 38 function pause1() |
| 39 { |
| 40 testExpected('getComputedStyle(button).display', 'flex'); |
| 41 |
| 42 video.controls = false; |
| 43 testExpected('getComputedStyle(button).display', 'none'); |
| 44 |
| 45 waitForEventOnce('play', play2); |
| 46 run('video.play()'); |
| 47 } |
| 48 |
| 49 function play2() |
| 50 { |
| 51 testExpected('getComputedStyle(button).display', 'none'); |
| 52 |
| 53 waitForEventOnce('pause', pause2); |
| 54 run('video.pause()'); |
| 55 } |
| 56 |
| 57 function pause2() |
| 58 { |
| 59 testExpected('getComputedStyle(button).display', 'none'); |
| 60 |
| 61 video.controls = true; |
| 62 testExpected('getComputedStyle(button).display', 'flex'); |
| 63 |
| 64 endTest(); |
| 65 } |
| 66 </script> |
| 67 </head> |
| 68 <body onload="start()"> |
| 69 <p>Test that the overlay play button respects the controls attribute</p> |
| 70 <video></video> |
| 71 </body> |
| 72 </html> |
OLD | NEW |