OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>media controls overlay play button narrow</title> |
| 3 <script src="../../../../resources/testharness.js"></script> |
| 4 <script src="../../../../resources/testharnessreport.js"></script> |
| 5 <script src="../../../../media/media-file.js"></script> |
| 6 <script src="../../../../media/media-controls.js"></script> |
| 7 <script src="overlay-play-button.js"></script> |
| 8 <script> |
| 9 async_test(function(t) { |
| 10 // Make sure the overlay play button is turned on, as it's typically off |
| 11 // unless we're dealing with Android. |
| 12 internals.settings.setMediaControlsOverlayPlayButtonEnabled(true); |
| 13 document.write('<video width="200" height="200" controls></video>'); |
| 14 var video = document.querySelector("video"); |
| 15 video.src = findMediaFile("video", "../../../../media/content/test"); |
| 16 |
| 17 video.onloadedmetadata = t.step_func(function() { |
| 18 // Large-enough video should have an overlay play button. |
| 19 assertOverlayPlayButtonVisible(video); |
| 20 |
| 21 // If the width goes under the minimum, the button should be hidden. |
| 22 video.width = MIN_VIDEO_WIDTH - 10; |
| 23 testRunner.layoutAndPaintAsyncThen(t.step_func(function() { |
| 24 assertOverlayPlayButtonNotVisible(video); |
| 25 |
| 26 // Re-widening the video should display the button. |
| 27 video.width = MIN_VIDEO_WIDTH; |
| 28 testRunner.layoutAndPaintAsyncThen(t.step_func(function() { |
| 29 assertOverlayPlayButtonVisible(video); |
| 30 |
| 31 // If the height goes under the minimum, the button should be hidden. |
| 32 video.height = MIN_VIDEO_HEIGHT - 10; |
| 33 testRunner.layoutAndPaintAsyncThen(t.step_func(function() { |
| 34 assertOverlayPlayButtonNotVisible(video); |
| 35 |
| 36 // Re-heightening the video should display the button. |
| 37 video.height = MIN_VIDEO_HEIGHT; |
| 38 testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { |
| 39 assertOverlayPlayButtonVisible(video); |
| 40 })); |
| 41 })); |
| 42 })); |
| 43 })); |
| 44 }); |
| 45 }); |
| 46 </script> |
OLD | NEW |