Index: third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html |
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html |
index ae2f5395d0861aed9fb8efef853ab6c629fcc737..f9e8c424a278ee285c99f19ca33722a11145c4ee 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html |
+++ b/third_party/WebKit/LayoutTests/media/track/track-cue-rendering-wider-than-controls.html |
@@ -1,9 +1,9 @@ |
<!DOCTYPE html> |
-<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 src=../media-controls.js></script> |
+<title>Test that the cue root is not constrained by the controls/overlay.</title> |
+<script src="../media-file.js"></script> |
+<script src="../media-controls.js"></script> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
<style> |
/* Enforce a max width on the controls enclosure, so |
* that it doesn't fill the entire player width. |
@@ -11,35 +11,29 @@ |
video::-webkit-media-controls-enclosure { |
max-width: 800px; |
} |
-</style> |
-<script> |
-var controlsContainer; |
-var cueRoot; |
- |
-window.onload = function() { |
- consoleWrite("Test that the cue root is not constrained by the controls/overlay."); |
- findMediaElement(); |
- video.src = findMediaFile('video', '../content/test'); |
- waitForEvent('seeked', function() { |
- // The width of the controls depends on UA style, so verify that our assumption holds. |
- controlsContainer = mediaControlsButton(video, "panel"); |
- testExpected("parseFloat(getComputedStyle(controlsContainer).width)", "800", "<="); |
- cueRoot = textTrackDisplayElement(video); |
- testExpected("parseFloat(getComputedStyle(cueRoot).width)", "800", ">"); |
- endTest(); |
- }); |
- waitForEventOnce('canplaythrough', function() { |
- video.currentTime = 2; |
- }); |
-}; |
-</script> |
-<style> |
video { |
width: 2000px; |
height: 750px; |
} |
</style> |
-<video controls> |
+<video> |
<track src="captions-webvtt/long-word.vtt" default> |
</video> |
+<script> |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
+ video.src = findMediaFile("video", "../content/test"); |
+ |
+ video.onseeked = t.step_func_done(function() { |
+ // The width of the controls depends on UA style, so verify that our assumption holds. |
+ var controlsContainer = mediaControlsButton(video, "panel"); |
+ assert_true(parseFloat(getComputedStyle(controlsContainer).width) <= 800); |
+ |
+ var cueRoot = textTrackDisplayElement(video); |
+ assert_true(parseFloat(getComputedStyle(cueRoot).width) > 800); |
+ }); |
+ |
+ video.currentTime = 2; |
+}); |
+</script> |