Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow.html

Issue 1856383002: Convert css cue track tests from video-test.js to testharness.js based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/css-cue-for-video-in-shadow-2.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698