| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>media controls download button preload none</title> | 2 <title>media controls download button preload none</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 controls preload="none" src="https://someexample.example/example.mp4"></v
ideo> | 7 <video controls preload="none" src="https://someexample.example/example.mp4"></v
ideo> |
| 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"); |
| 11 | 11 |
| 12 testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { | 12 testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { |
| 13 assert_true(isVisible(downloadButton(video))); | 13 assert_true(isVisible(downloadButton(video))); |
| 14 })); | 14 })); |
| 15 | 15 |
| 16 function downloadButton(videoElement) { | 16 function downloadButton(videoElement) { |
| 17 var controlID = '-internal-media-controls-download-button'; | 17 var controlID = '-internal-media-controls-download-button'; |
| 18 var button = mediaControlsElement( | 18 var button = mediaControlsElement( |
| 19 window.internals.shadowRoot(videoElement).firstChild, controlID); | 19 window.internals.shadowRoot(videoElement).firstChild, controlID); |
| 20 if (!button) | 20 if (!button) |
| 21 throw 'Failed to find download button'; | 21 throw 'Failed to find download button'; |
| 22 return button; | 22 return button; |
| 23 } | 23 } |
| 24 | |
| 25 function isVisible(button) { | |
| 26 var computedStyle = getComputedStyle(button); | |
| 27 return computedStyle.display !== "none" && | |
| 28 computedStyle.visibility === "visible"; | |
| 29 } | |
| 30 }); | 24 }); |
| 31 </script> | 25 </script> |
| OLD | NEW |