Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>media controls cast button</title> | |
| 3 <script src="../../resources/testharness.js"></script> | |
| 4 <script src="../../resources/testharnessreport.js"></script> | |
| 5 <script src="../media-file.js"></script> | |
| 6 <script src="../media-controls.js"></script> | |
| 7 <video controls preload="none" src="https://someexample.example/example.mp4"></v ideo> | |
| 8 <script> | |
| 9 async_test(function(t) { | |
| 10 var video = document.querySelector("video"); | |
| 11 | |
| 12 testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { | |
| 13 assert_true(isVisible(downloadButton(video))); | |
| 14 })); | |
|
mlamouri (slow - plz ping)
2017/03/04 14:10:01
What would happen if preload kicks in? Does the do
steimel
2017/03/06 17:44:12
Fixed to make the button disappear when preload ki
| |
| 15 | |
| 16 function downloadButton(videoElement) { | |
| 17 var controlID = '-internal-media-controls-download-button'; | |
| 18 var button = mediaControlsElement( | |
| 19 window.internals.shadowRoot(videoElement).firstChild, controlID); | |
| 20 if (!button) | |
| 21 throw 'Failed to find download button'; | |
| 22 return button; | |
| 23 } | |
| 24 | |
| 25 function isVisible(button) { | |
| 26 var computedStyle = getComputedStyle(button); | |
| 27 return computedStyle.display !== "none" && | |
| 28 computedStyle.visibility === "visible"; | |
| 29 } | |
| 30 }); | |
| 31 </script> | |
| OLD | NEW |