Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html |
| diff --git a/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3878165562a1c44e2b479db8835b0bcb4ce59e08 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/media/video-controls-overflow-menu-closed-captions-button.html |
| @@ -0,0 +1,42 @@ |
| +<!DOCTYPE html> |
| +<title>Clicking on the overflow closed captions button shows the closed captions menu.</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="media-controls.js"></script> |
| +<script src="media-file.js"></script> |
| +<script src="overflow-menu.js"></script> |
| + |
| +<!--Padding ensures the overflow menu is visible for the tests. --> |
| +<body style="padding: 300px"> |
|
mlamouri (slow - plz ping)
2016/09/06 10:25:44
If you use padding-top, it would be clearer (same
kdsilva
2016/09/06 17:32:45
Done. Although it looks like we'd need to have it
|
| +<video controls></video> |
| +<script> |
| +async_test(function(t) { |
| + // Set up video |
| + var video = document.querySelector("video"); |
| + video.src = findMediaFile("video", "content/test"); |
| + video.setAttribute("width", "60"); |
| + // Add captions |
| + var track = video.addTextTrack("captions"); |
| + |
| + video.onloadeddata = t.step_func_done(function() { |
| + var overflowList = getOverflowList(video); |
| + var overflowMenu = getOverflowMenuButton(video); |
| + |
| + // Get the menu that displays the list of text tracks |
| + var captionsList = mediaControlsElement(internals.shadowRoot(video).firstChild, "-internal-media-controls-text-track-list"); |
| + |
| + // Initially the list should not be visible |
| + assert_equals(getComputedStyle(captionsList).display, "none"); |
| + |
| + // Click on the overflow menu button |
| + var coords = elementCoordinates(overflowMenu); |
| + clickAtCoordinates(coords[0], coords[1]); |
| + |
| + // Click on the closed captions button |
| + var coords = elementCoordinates(overflowList.children[OverflowMenuButtons.CLOSED_CAPTIONS]); |
| + clickAtCoordinates(coords[0], coords[1]); |
| + assert_not_equals(getComputedStyle(captionsList).display, "none"); |
| + }); |
| +}); |
| +</script> |
| +</body> |