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>
11 window
.internals
.settings
.setMediaControlsOverlayPlayButtonEnabled(true);
13 // Add element dynamically, since otherwise the controls are created, but
14 // hidden, before the setting is set, causing the setting to be ignored.
19 video
.controls
= true;
21 button
= mediaControlsButton(video
, 'overlay-play-button')
22 testExpected('getComputedStyle(button).display', 'flex');
24 waitForEventOnce('loadeddata', loadeddata
);
25 video
.src
= findMediaFile('video', 'content/test');
28 function addVideoElement() {
29 element
= document
.createElement('video');
30 document
.body
.appendChild(element
);
35 waitForEventOnce('play', play1
);
41 testExpected('getComputedStyle(button).display', 'none');
43 waitForEventOnce('pause', pause1
);
49 testExpected('getComputedStyle(button).display', 'flex');
51 video
.controls
= false;
52 testExpected('getComputedStyle(button).display', 'none');
54 waitForEventOnce('play', play2
);
60 testExpected('getComputedStyle(button).display', 'none');
62 waitForEventOnce('pause', pause2
);
68 testExpected('getComputedStyle(button).display', 'none');
70 video
.controls
= true;
71 testExpected('getComputedStyle(button).display', 'flex');
77 <body onload=
"start()">
78 <p>Test that the overlay play button respects the controls attribute
</p>