| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>media controls cast button</title> | 2 <title>media controls cast button</title> |
| 3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="media-file.js"></script> | 5 <script src="media-file.js"></script> |
| 6 <script src="media-controls.js"></script> | 6 <script src="media-controls.js"></script> |
| 7 <video width="100" height="200" controls></video> | 7 <video width="100" height="200" controls></video> |
| 8 <script> | 8 <script> |
| 9 async_test(function(t) { | 9 async_test(function(t) { |
| 10 var video = document.querySelector("video"); | 10 var video = document.querySelector("video"); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // If the cast device is lost, we still don't show the cast | 34 // If the cast device is lost, we still don't show the cast |
| 35 // button when the video width increases. | 35 // button when the video width increases. |
| 36 internals.mediaPlayerRemoteRouteAvailabilityChanged(video, false
); | 36 internals.mediaPlayerRemoteRouteAvailabilityChanged(video, false
); |
| 37 video.width = 500; | 37 video.width = 500; |
| 38 testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { | 38 testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { |
| 39 assert_false(isVisible(castButton(video)), "button should no
t be visible"); | 39 assert_false(isVisible(castButton(video)), "button should no
t be visible"); |
| 40 })); | 40 })); |
| 41 })); | 41 })); |
| 42 })); | 42 })); |
| 43 }); | 43 }); |
| 44 | |
| 45 function isVisible(button) { | |
| 46 var computedStyle = getComputedStyle(button); | |
| 47 return computedStyle.display !== "none" && | |
| 48 computedStyle.display !== "hidden" && | |
| 49 computedStyle.visibility === "visible"; | |
| 50 } | |
| 51 }); | 44 }); |
| 52 </script> | 45 </script> |
| OLD | NEW |