| Index: third_party/WebKit/LayoutTests/media/track/track-disabled.html
|
| diff --git a/third_party/WebKit/LayoutTests/media/track/track-disabled.html b/third_party/WebKit/LayoutTests/media/track/track-disabled.html
|
| index 88c749bfcc7ab9df2802e04efea26b150857b637..5b44aa820fa051a5603169be5ee4a0690679797b 100644
|
| --- a/third_party/WebKit/LayoutTests/media/track/track-disabled.html
|
| +++ b/third_party/WebKit/LayoutTests/media/track/track-disabled.html
|
| @@ -1,38 +1,29 @@
|
| <!DOCTYPE html>
|
| -<html>
|
| - <head>
|
| - <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>
|
| - if (window.testRunner)
|
| - testRunner.dumpAsText();
|
| +<title>Test disabling a track.</title>
|
| +<video>
|
| + <track kind="subtitles" src="captions-webvtt/captions.vtt"/>
|
| +</video>
|
| +<script src="../media-file.js"></script>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| +async_test(function(t) {
|
| + var video = document.querySelector("video");
|
| + video.textTracks[0].mode = "disabled";
|
|
|
| - waitForEvent('loadstart', function ()
|
| - {
|
| - var video = document.getElementById('vid');
|
| - video.textTracks[0].mode = "disabled";
|
| + // Waiting for the duration of the first cue to elapse.
|
| + video.ontimeupdate = t.step_func(function (e) {
|
| + if (e.target.currentTime < 1)
|
| + return;
|
|
|
| - consoleWrite("Waiting for the duration of the first cue to elapse.");
|
| - video.addEventListener('timeupdate', function (e)
|
| - {
|
| - if (e.target.currentTime < 1)
|
| - return;
|
| + // End test after the duration of the first cue to make sure
|
| + // the test doesn't crash during the period this cue would
|
| + // have been rendered if the track was not disabled.
|
| + // The duration of the first cue has elapsed.
|
| + t.done();
|
| + });
|
|
|
| - // End test after the duration of the first cue to make sure the test
|
| - // doesn't crash during the period this cue would have been
|
| - // rendered if the track was not disabled.
|
| - consoleWrite("The duration of the first cue has elapsed.");
|
| - endTest();
|
| - });
|
| - });
|
| -
|
| - </script>
|
| - </head>
|
| - <body>
|
| - <video id="vid" src="../content/test.ogv" autoplay controls>
|
| - <track kind='subtitles' srclang='en' label='English' src='captions-webvtt/captions.vtt' />
|
| - </video>
|
| - </body>
|
| -</html>
|
| + video.src = findMediaFile("video", "../content/test");
|
| + video.play();
|
| +});
|
| +</script>
|
|
|