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

Unified Diff: third_party/WebKit/LayoutTests/media/video-controls-captions.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
Index: third_party/WebKit/LayoutTests/media/video-controls-captions.html
diff --git a/third_party/WebKit/LayoutTests/media/video-controls-captions.html b/third_party/WebKit/LayoutTests/media/video-controls-captions.html
deleted file mode 100644
index 608bcbe3cc37904f45331a45320d4c33555ba9f5..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/media/video-controls-captions.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html>
-<title>Tests that the closed captions button enables track switching.</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>
- <track src="track/captions-webvtt/captions-fast.vtt" kind="captions">
- <track src="track/captions-webvtt/captions-rtl.vtt" kind="captions">
-</video>
-<script>
-async_test(function(t) {
- var video = document.querySelector("video");
-
- video.oncanplaythrough = t.step_func(function() {
- assert_true(isClosedCaptionsButtonVisible(video));
-
- // The captions track should be listed in textTracks, but not yet loaded.
- assert_equals(video.textTracks.length, 2);
- assert_equals(video.textTracks[0].mode, "disabled");
- assert_equals(textTrackContainerElement(video), null);
-
- var tracks = document.querySelectorAll("track");
- tracks[0].onload = t.step_func(function() {
- assert_equals(textTrackDisplayElement(video).innerText, "Lorem");
-
- // Captions should not be visible after Off is clicked.
- turnClosedCaptionsOff(video);
- assert_equals(textTrackDisplayElement(video), null);
-
- // Remove DOM node representing the track element.
- tracks[1].remove();
- tracks[0].remove();
- assert_false(isClosedCaptionsButtonVisible(video));
-
- addUnloadableHTMLTrackElement();
- assert_true(isClosedCaptionsButtonVisible(video));
-
- clickTextTrackAtIndex(video, 0);
- });
-
- // Captions track should load and captions should become visible after a track is selected.
- clickTextTrackAtIndex(video, 0);
- });
-
- function addUnloadableHTMLTrackElement() {
- // Add non-default text track through HTML with unloadable URI.
- var track = document.createElement("track");
- track.setAttribute("kind", "captions");
- track.setAttribute("srclang", "en");
- track.setAttribute("src", "invalid.vtt");
-
- track.onerror = t.step_func_done(function() {
- // Track failed to load.
- assert_false(isClosedCaptionsButtonVisible(video));
- // Add a text track through JS to the video element.
- var newTrack = video.addTextTrack("captions", "English", "en");
- assert_true(isClosedCaptionsButtonVisible(video));
- });
-
- video.appendChild(track);
- assert_equals(track.readyState, HTMLTrackElement.NONE);
- assert_equals(track.track.mode, "disabled");
- assert_equals(video.textTracks.length, 1);
- }
-
- video.src = findMediaFile("video", "content/counting");
-});
-</script>

Powered by Google App Engine
This is Rietveld 408576698