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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html

Issue 1942633002: Convert track-mode* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 months 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/track/track-mode-disabled-crash.html
diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html b/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html
index 9902434635ee0ccbe329412264b4f4ad22580522..4ed7a1e2528d7580df480da6da1d72799e6f8963 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html
+++ b/third_party/WebKit/LayoutTests/media/track/track-mode-disabled-crash.html
@@ -1,55 +1,35 @@
<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script src=../media-file.js></script>
- <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=../video-test.js></script>
- <script>
- var testTrack;
-
- function seeked()
- {
- consoleWrite("** Set the mode of the text track to hidden, then showing again. **");
- testTrack.track.mode = "hidden";
- testTrack.track.mode = "showing";
-
- consoleWrite("** Set the mode of the text track to disabled. **");
- testTrack.track.mode = "disabled";
-
- consoleWrite("");
- consoleWrite("No crash. PASS.");
- consoleWrite("");
-
- endTest();
- }
-
- function startTest()
- {
- consoleWrite("** Set the mode of the text track to showing. **");
- testTrack.track.mode = "showing";
- consoleWrite("** Seek to a time with a caption. **");
- video.currentTime = 1.5;
- }
-
- function loaded()
- {
- findMediaElement();
- testTrack = document.querySelector('track');
-
- video.src = findMediaFile('video', '../content/counting');
- waitForEvent('seeked', seeked);
- waitForEvent('canplaythrough', startTest);
- }
-
- </script>
- </head>
- <body onload="loaded()">
- <video controls >
- <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default >
- </video>
- <p>Tests that cues are properly removed from the active cue list when their track changes mode to disabled.</p>
- </body>
-</html>
+<title>Tests that cues are properly removed from the active cue list when their track changes mode to disabled.</title>
+<script src="../media-file.js"></script>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<video>
+ <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default >
+</video>
+<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+ var testTrack = document.querySelector("track");
+
+ video.src = findMediaFile("video", "../content/counting");
+ video.oncanplaythrough = t.step_func(startTest);
+ video.onseeked = t.step_func_done(seeked);
+
+ function startTest() {
+ // Set the mode of the text track to showing.
+ testTrack.track.mode = "showing";
+ // Seek to a time with a caption.
+ video.currentTime = 1.5;
+ }
+
+ function seeked() {
+ // Set the mode of the text track to hidden, then showing again.
+ testTrack.track.mode = "hidden";
+ testTrack.track.mode = "showing";
+
+ // Set the mode of the text track to disabled.
+ testTrack.track.mode = "disabled";
+ // No crash, PASS.
+ }
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698