Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html |
| diff --git a/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html b/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..707b213e90bd47fab66017f9323185c7f5fa7dc8 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/media/controls/download-button-displays-with-preload-none.html |
| @@ -0,0 +1,31 @@ |
| +<!DOCTYPE html> |
| +<title>media controls cast button</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script src="../media-file.js"></script> |
| +<script src="../media-controls.js"></script> |
| +<video controls preload="none" src="https://someexample.example/example.mp4"></video> |
| +<script> |
| +async_test(function(t) { |
| + var video = document.querySelector("video"); |
| + |
| + testRunner.layoutAndPaintAsyncThen(t.step_func_done(function() { |
| + assert_true(isVisible(downloadButton(video))); |
| + })); |
|
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
|
| + |
| + function downloadButton(videoElement) { |
| + var controlID = '-internal-media-controls-download-button'; |
| + var button = mediaControlsElement( |
| + window.internals.shadowRoot(videoElement).firstChild, controlID); |
| + if (!button) |
| + throw 'Failed to find download button'; |
| + return button; |
| + } |
| + |
| + function isVisible(button) { |
| + var computedStyle = getComputedStyle(button); |
| + return computedStyle.display !== "none" && |
| + computedStyle.visibility === "visible"; |
| + } |
| +}); |
| +</script> |