Index: third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html |
diff --git a/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html b/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html |
index 23c2257b5f8f5d4199285eed141a92f2bbefaed9..a068b9a0737d172caa5a9054e0c79e0181987fec 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html |
+++ b/third_party/WebKit/LayoutTests/media/track/track-css-matching-default.html |
@@ -1,48 +1,30 @@ |
<!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 src=../media-controls.js></script> |
- |
- <script> |
- |
- var cueNode; |
- |
- function seeked() |
- { |
- if (testEnded) |
- return; |
- |
- cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; |
- testExpected("getComputedStyle(cueNode).fontWeight", "bold"); |
- cueNode = cueNode.nextElementSibling; |
- testExpected("getComputedStyle(cueNode).fontStyle", "italic"); |
- cueNode = cueNode.nextElementSibling; |
- testExpected("getComputedStyle(cueNode).textDecoration", "underline solid rgb(255, 255, 255)"); |
- |
- endTest(); |
- } |
- |
- function loaded() |
- { |
- consoleWrite("Test that u, b, i WebVTT objects are being styled correctly."); |
- findMediaElement(); |
- video.src = findMediaFile('video', '../content/test'); |
- video.id = "testvideo"; |
- waitForEvent('seeked', seeked); |
- waitForEvent('canplaythrough', function() { video.currentTime = 0.1; }); |
- } |
- |
- </script> |
- </head> |
- <body onload="loaded()"> |
- <video controls > |
- <track src="captions-webvtt/styling-default.vtt" kind="captions" default> |
- </video> |
- </body> |
-</html> |
+<title>Test that u, b, i WebVTT objects are being styled correctly.</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> |
+<video></video> |
+<script> |
+async_test(function(t) { |
+ var video = document.querySelector('video'); |
+ video.src = findMediaFile('video', '../content/test'); |
+ |
+ var track = document.createElement('track'); |
+ track.src = 'captions-webvtt/styling-default.vtt'; |
+ track.kind = 'captions'; |
+ track.default = true; |
+ video.appendChild(track); |
+ |
+ video.onseeked = t.step_func_done(function() { |
+ var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild; |
+ assert_equals(getComputedStyle(cueNode).fontWeight, 'bold'); |
+ cueNode = cueNode.nextElementSibling; |
+ assert_equals(getComputedStyle(cueNode).fontStyle, 'italic'); |
+ cueNode = cueNode.nextElementSibling; |
+ assert_equals(getComputedStyle(cueNode).textDecoration, 'underline solid rgb(255, 255, 255)'); |
+ }); |
+ |
+ video.currentTime = 0.1; |
+}); |
+</script> |