| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Hiding the cast overlay button</title> | 4 <title>Hiding the cast overlay button</title> |
| 5 <script src="media-controls.js"></script> | 5 <script src="../media-controls.js"></script> |
| 6 <script src="../resources/testharness.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
| 7 <script src="../resources/testharnessreport.js"></script> | 7 <script src="../../resources/testharnessreport.js"></script> |
| 8 <style> | 8 <style> |
| 9 body { background-color: gray; } | 9 body { background-color: gray; } |
| 10 .video-group { position: absolute; } | 10 .video-group { position: absolute; } |
| 11 .video-group > * { position: absolute; top: 0; } | 11 .video-group > * { position: absolute; top: 0; } |
| 12 .overlay {border: solid 1px; height: 50px; width: 80px; } | 12 .overlay {border: solid 1px; height: 50px; width: 80px; } |
| 13 .video { width: 320px; height: 240px; background-color: white; } | 13 .video { width: 320px; height: 240px; background-color: white; } |
| 14 .test-error { position: absolute; top: 250px; } | 14 .test-error { position: absolute; top: 250px; } |
| 15 #v2 { top: 300px; } | 15 #v2 { top: 300px; } |
| 16 </style> | 16 </style> |
| 17 </head> | 17 </head> |
| 18 <body onload="async_test(testOverlayVisibility)"> | 18 <body onload="async_test(testOverlayVisibility)"> |
| 19 <div id="v1" class="video-group"> | 19 <div id="v1" class="video-group"> |
| 20 <video src="resources/test-positive-start-time.webm" | 20 <video src="../resources/test-positive-start-time.webm" |
| 21 class="should-not-have-overlay-btn"></video> | 21 class="should-not-have-overlay-btn"></video> |
| 22 <div class="overlay"></div> | 22 <div class="overlay"></div> |
| 23 </div> | 23 </div> |
| 24 <div id="v2" class="video-group"> | 24 <div id="v2" class="video-group"> |
| 25 <video src="resources/test-positive-start-time.webm" | 25 <video src="../resources/test-positive-start-time.webm" |
| 26 class="should-have-overlay-btn"></video> | 26 class="should-have-overlay-btn"></video> |
| 27 </div> | 27 </div> |
| 28 <script> | 28 <script> |
| 29 function testOverlayVisibility(test) { | 29 function testOverlayVisibility(test) { |
| 30 var videos = document.getElementsByTagName('video'); | 30 var videos = document.getElementsByTagName('video'); |
| 31 for (var i = 0; i < videos.length; i++) { | 31 for (var i = 0; i < videos.length; i++) { |
| 32 internals.mediaPlayerRemoteRouteAvailabilityChanged(videos[i], t
rue); | 32 internals.mediaPlayerRemoteRouteAvailabilityChanged(videos[i], t
rue); |
| 33 | 33 |
| 34 assert_equals(isCastButtonVisible(videos[i]), | 34 assert_equals(isCastButtonVisible(videos[i]), |
| 35 videos[i].classList.contains('should-have-overlay-
btn'), | 35 videos[i].classList.contains('should-have-overlay-
btn'), |
| 36 videos[i].parentNode.id + ' - overlay cast button
visibility error.'); | 36 videos[i].parentNode.id + ' - overlay cast button
visibility error.'); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 test.done(); | 39 test.done(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 function isCastButtonVisible(videoElement) | 42 function isCastButtonVisible(videoElement) |
| 43 { | 43 { |
| 44 var btn = overlayCastButton(videoElement); | 44 var btn = overlayCastButton(videoElement); |
| 45 return btn.style.display != 'none' && btn.style.visibility != 'hidde
n'; | 45 return btn.style.display != 'none' && btn.style.visibility != 'hidde
n'; |
| 46 } | 46 } |
| 47 </script> | 47 </script> |
| 48 </body> | 48 </body> |
| 49 </html> | 49 </html> |
| OLD | NEW |