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

Unified Diff: third_party/WebKit/LayoutTests/media/track/track-helpers.js

Issue 2051233004: Convert track-webvtt-tc[024-026] tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits Created 4 years, 6 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/track-webvtt-tc024-timestamp.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/track-helpers.js
diff --git a/third_party/WebKit/LayoutTests/media/track/track-helpers.js b/third_party/WebKit/LayoutTests/media/track/track-helpers.js
index a377ae0628c054457dfd5bb0b4ea884d6ced089a..12e8aff7354523530d3a05289bb7a7b5b587fc42 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-helpers.js
+++ b/third_party/WebKit/LayoutTests/media/track/track-helpers.js
@@ -45,6 +45,11 @@ function assert_cue_fragment(cue, children) {
assert_true(fragment.isEqualNode(cue.getCueAsHTML()));
}
+function assert_cue_fragment_as_textcontent(cue, children) {
+ var fragment = createFragment(children);
+ assert_equals(cue.getCueAsHTML().textContent, fragment.textContent);
+}
+
function createFragment(children) {
var fragment = document.createDocumentFragment();
cloneChildrenToFragment(fragment, children);
@@ -58,6 +63,9 @@ function cloneChildrenToFragment(root, children) {
childElement = document.createTextNode(child.value);
} else {
childElement = document.createElement(child.type);
+ var styles = child.style || {};
+ for (var attr of Object.getOwnPropertyNames(styles))
+ childElement[attr] = styles[attr];
cloneChildrenToFragment(childElement, child.value);
}
root.appendChild(childElement);
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/media/track/track-webvtt-tc024-timestamp.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698