Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-updates-appropriately.html

Issue 2539023002: Media Controls: Use events to update controls for closed captions. (Closed)
Patch Set: review comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-updates-appropriately.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-updates-appropriately.html b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-updates-appropriately.html
index e02af246d28bcfbd7cc5a8b566becfd9451d6072..a4ace4f324d44549acb19eaad3537568022a6fef 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-updates-appropriately.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-controls-overflow-menu-updates-appropriately.html
@@ -1,27 +1,29 @@
<!DOCTYPE html>
<title>Overflow menu updates properly.</title>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="../../media-resources/media-controls.js"></script>
-<script src="../../media-resources/media-file.js"></script>
-<script src="../../media-resources/overflow-menu.js"></script>
+<script src='../resources/testharness.js'></script>
+<script src='../resources/testharnessreport.js'></script>
+<script src='../../media-resources/media-controls.js'></script>
+<script src='../../media-resources/media-file.js'></script>
+<script src='../../media-resources/overflow-menu.js'></script>
<!--Padding ensures the overflow menu is visible for the tests. -->
-<body style="padding-top: 200px; padding-left: 100px">
+<body style='padding-top: 200px; padding-left: 100px'>
<video controls></video>
<script>
-async_test(function(t) {
+async_test(t => {
+ assert_true('internals' in window, 'window.internals must be available');
+
// Set up video
- var video = document.querySelector("video");
- video.src = findMediaFile("video", "resources/test");
- video.setAttribute("width", "60");
+ var video = document.querySelector('video');
+ video.src = findMediaFile('video', 'resources/test');
+ video.setAttribute('width', '60');
// Add captions
- var trackElement = document.createElement("track");
+ var trackElement = document.createElement('track');
video.appendChild(trackElement);
// Pretend we have a cast device
internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true);
- video.onloadeddata = t.step_func_done(function() {
+ video.onloadeddata = t.step_func(_ => {
var overflowList = getOverflowList(video);
// Remove cast device and ensure the overflow menu updates as expected
@@ -35,19 +37,22 @@ async_test(function(t) {
// Ensure that all of the buttons are visible in the right order
for (var i = 0; i < children.length; i++) {
var child = children[i];
- if (buttonsWithoutCast[i]) {
- assert_not_equals(getComputedStyle(child).display, "none");
- } else {
- assert_equals(getComputedStyle(child).display, "none");
- }
+ if (buttonsWithoutCast[i])
+ assert_not_equals(getComputedStyle(child).display, 'none');
+ else
+ assert_equals(getComputedStyle(child).display, 'none');
}
internals.mediaPlayerRemoteRouteAvailabilityChanged(video, true);
- assert_not_equals(getComputedStyle(children[OverflowMenuButtons.CAST]).display, "none");
+ assert_not_equals(getComputedStyle(children[OverflowMenuButtons.CAST]).display, 'none');
// Removing closed captions hides button in overflow menu
- assert_not_equals(getComputedStyle(children[OverflowMenuButtons.CLOSED_CAPTIONS]).display, "none");
+ assert_not_equals(getComputedStyle(children[OverflowMenuButtons.CLOSED_CAPTIONS]).display, 'none');
video.removeChild(trackElement);
- assert_equals(getComputedStyle(children[OverflowMenuButtons.CLOSED_CAPTIONS]).display, "none");
+
+ // The controls are updated asynchronously.
+ setTimeout(t.step_func_done(_ => {
+ assert_equals(getComputedStyle(children[OverflowMenuButtons.CLOSED_CAPTIONS]).display, 'none');
+ }));
});
});
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/controls/closed-captions-dynamic-update.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698