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

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 comments 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..e51329ef1725ab47eb9e7827e0a07b0fbb5b4da4 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);
@@ -56,6 +61,10 @@ function cloneChildrenToFragment(root, children) {
var childElement;
if (child.type == "text") {
childElement = document.createTextNode(child.value);
+ } else if (child.type == "style") {
fs 2016/06/11 18:04:18 I was actually thinking more like: ... { type: "s
Srirama 2016/06/12 06:06:16 Done.
+ var style = child.value;
+ for (var attr of Object.getOwnPropertyNames(style))
+ root[attr] = style[attr];
} else {
childElement = document.createElement(child.type);
cloneChildrenToFragment(childElement, child.value);
« 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