| Index: third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
|
| diff --git a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
|
| index 5d82bd5d118fa0633f4ebb646e91956c6b244684..18267531b758a70fbb6cd6027623a35fcc9e6eb4 100644
|
| --- a/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
|
| +++ b/third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html
|
| @@ -1,53 +1,31 @@
|
| <!DOCTYPE html>
|
| -<html>
|
| -<head>
|
| -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
| +<title>Test that the cue is not styled when video is in a shadow tree and style is in a document.</title>
|
| <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 src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| <style>
|
| video::cue(.red, .red2) { color:red }
|
| video::cue(.green) { color:green }
|
| </style>
|
| +<div id='host'>
|
| +</div>
|
| <script>
|
| -var cueNode;
|
| -var seekedCount = 0;
|
| -var step = 0.4;
|
| -var initialTime = 0.6;
|
| -var endTime = 3.0
|
| -
|
| -function seeked()
|
| -{
|
| - if (testEnded)
|
| - return;
|
| -
|
| - cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
|
| - testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)", "!=");
|
| - cueNode = cueNode.nextElementSibling;
|
| - testExpected("getComputedStyle(cueNode).color", "rgb(0, 128, 0)", "!=");
|
| - cueNode = cueNode.nextElementSibling;
|
| - testExpected("getComputedStyle(cueNode).color", "rgb(255, 0, 0)", "!=");
|
| - endTest();
|
| -}
|
| -
|
| -function loaded()
|
| -{
|
| - consoleWrite("Test that the cue is not styled when video is in a shadow tree and style is in a document.");
|
| +async_test(function(t) {
|
| var host = document.getElementById('host');
|
| var shadowRoot = host.createShadowRoot();
|
| shadowRoot.innerHTML = '<video controls ><track src="captions-webvtt/styling-lifetime.vtt" kind="captions" default></video>';
|
| - video = shadowRoot.querySelector('video');
|
| + var video = shadowRoot.querySelector('video');
|
| video.src = findMediaFile('video', '../content/test');
|
| video.id = "testvideo";
|
| - waitForEvent('seeked', seeked);
|
| - waitForEventOnce('canplaythrough', function() { video.currentTime = initialTime; });
|
| -}
|
| + video.onseeked = t.step_func_done(function() {
|
| + var cueNode = textTrackDisplayElement(video, 'cue').firstElementChild;
|
| + assert_equals(getComputedStyle(cueNode).color, "rgb(255, 255, 255)");
|
| + cueNode = cueNode.nextElementSibling;
|
| + assert_equals(getComputedStyle(cueNode).color, "rgb(255, 255, 255)");
|
| + cueNode = cueNode.nextElementSibling;
|
| + assert_equals(getComputedStyle(cueNode).color, "rgb(255, 255, 255)");
|
| + });
|
| + video.currentTime = 0.6;
|
| +});
|
| </script>
|
| -</head>
|
| -<body onload="loaded()">
|
| -<div id='host'>
|
| -</div>
|
| -</body>
|
| -</html>
|
|
|