| Index: third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html | 
| diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html b/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html | 
| index 364e6a6812aee790c4012279f64ca7da29179c60..5c491b1e90ae193a84e0f13dad5117aabfe0b6d0 100644 | 
| --- a/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html | 
| +++ b/third_party/WebKit/LayoutTests/media/track/track-cues-enter-exit.html | 
| @@ -1,84 +1,42 @@ | 
| <!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 cueCount = 0; | 
| -        var currentCue; | 
| -        var testTrack; | 
| - | 
| -        var trackLoaded = false; | 
| -        var videoCanPlayThrough = false; | 
| - | 
| -        function attemptTests() | 
| -        { | 
| -            if (!trackLoaded || !videoCanPlayThrough) | 
| -                return; | 
| - | 
| -            testTrack = document.getElementById("testTrack"); | 
| -            testExpected("testTrack.track.cues.length", 3); | 
| -            for (var i = 0; i < testTrack.track.cues.length; i++) { | 
| -                testTrack.track.cues[i].addEventListener('enter', cueEntered); | 
| -                testTrack.track.cues[i].addEventListener('exit', cueExited); | 
| -            } | 
| -            run("video.play()"); | 
| -            consoleWrite(""); | 
| -        } | 
| - | 
| -        function cueEntered() | 
| -        { | 
| -            consoleWrite("EVENT(enter)"); | 
| - | 
| -            currentCue = event.target; | 
| - | 
| -            consoleWrite("This cue is the currently active cue:"); | 
| -            testExpected(currentCue, testTrack.track.activeCues[0]); | 
| -            testExpected("currentCue.id", cueCount + 1); | 
| -            consoleWrite(""); | 
| -        } | 
| - | 
| -        function cueExited() | 
| -        { | 
| -            consoleWrite("EVENT(exit)"); | 
| -            consoleWrite(""); | 
| - | 
| -            ++cueCount; | 
| -            if (cueCount == testTrack.track.cues.length) | 
| -                endTest(); | 
| -        } | 
| - | 
| -        waitForEvent('canplaythrough', | 
| -            function () | 
| -            { | 
| -                videoCanPlayThrough = true; | 
| -                attemptTests(); | 
| -            } | 
| -        ); | 
| - | 
| -        function loaded() | 
| -        { | 
| -            trackLoaded = true; | 
| -            attemptTests(); | 
| -        } | 
| - | 
| -        function start() | 
| -        { | 
| -            findMediaElement(); | 
| -            video.src = findMediaFile("video", "../content/test"); | 
| +<title>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.</title> | 
| +<script src="../media-file.js"></script> | 
| +<script src="../../resources/testharness.js"></script> | 
| +<script src="../../resources/testharnessreport.js"></script> | 
| +<video> | 
| +    <track src="captions-webvtt/cues-chrono-order.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/test"); | 
| + | 
| +    video.oncanplaythrough = t.step_func(attemptTests); | 
| + | 
| +    function attemptTests() { | 
| +        assert_equals(testTrack.track.cues.length, 3); | 
| +        for (var i = 0; i < testTrack.track.cues.length; i++) { | 
| +            testTrack.track.cues[i].onenter = t.step_func(cueEntered); | 
| +            testTrack.track.cues[i].onexit = t.step_func(cueExited); | 
| } | 
| -        </script> | 
| -    </head> | 
| -    <body onload="start()"> | 
| -        <p>Tests that TextTrack's cues are indexed and updated in order during video playback. Test uses the enter and exits events on TextTrackCue.</p> | 
| -        <video controls> | 
| -            <track id="testTrack" src="captions-webvtt/cues-chrono-order.vtt" kind="captions" onload="loaded()" default> | 
| -        </video> | 
| -    </body> | 
| -</html> | 
| +        video.play(); | 
| +    } | 
| + | 
| +    var cueCount = 0; | 
| +    function cueEntered() { | 
| +        var currentCue = event.target; | 
| + | 
| +        // This cue is the currently active cue. | 
| +        assert_equals(currentCue, testTrack.track.activeCues[0]); | 
| +        assert_equals(currentCue.id, (cueCount + 1).toString()); | 
| +    } | 
| + | 
| +    function cueExited() { | 
| +        ++cueCount; | 
| +        if (cueCount == testTrack.track.cues.length) | 
| +            t.done(); | 
| +    } | 
| +}); | 
| +</script> | 
|  |