4 <title>Hiding the cast overlay button
</title>
5 <script src=
"media-controls.js"></script>
6 <script src=
"../resources/testharness.js"></script>
7 <script src=
"../resources/testharnessreport.js"></script>
9 body { background-color: gray; }
10 .video-group { position: absolute; }
11 .video-group
> * { position: absolute; top:
0; }
12 .overlay {border: solid
1px; height:
50px; width:
80px; }
13 .video { width:
320px; height:
240px; background-color: white; }
14 .test-error { position: absolute; top:
250px; }
18 <body onload=
"async_test(testOverlayVisibility)">
19 <div id=
"v1" class=
"video-group">
20 <video src=
"resources/test-positive-start-time.webm"
21 class=
"should-not-have-overlay-btn"></video>
22 <div class=
"overlay"></div>
24 <div id=
"v2" class=
"video-group">
25 <video src=
"resources/test-positive-start-time.webm"
26 class=
"should-have-overlay-btn"></video>
29 function testOverlayVisibility(test
) {
30 var videos
= document
.getElementsByTagName('video');
31 for (var i
= 0; i
< videos
.length
; i
++) {
32 internals
.mediaPlayerRemoteRouteAvailabilityChanged(videos
[i
], true);
34 assert_equals(isCastButtonVisible(videos
[i
]),
35 videos
[i
].classList
.contains('should-have-overlay-btn'),
36 videos
[i
].parentNode
.id
+ ' - overlay cast button visibility error.');
42 function isCastButtonVisible(videoElement
)
44 var btn
= overlayCastButton(videoElement
);
45 return btn
.style
.display
!= 'none' && btn
.style
.visibility
!= 'hidden';