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 0e5db69461f06b2ae6e8442795cb30ee5599718f..c8ee628dedb02ab781a0773ca65aaba140a590a1 100644 |
--- a/third_party/WebKit/LayoutTests/media/track/track-helpers.js |
+++ b/third_party/WebKit/LayoutTests/media/track/track-helpers.js |
@@ -16,12 +16,26 @@ function assert_cues_equal(cues, expected) { |
} |
} |
-function assert_cues_match(cues, expected, properties) { |
+function assert_cues_match(cues, expected) { |
assert_equals(cues.length, expected.length); |
for (var i = 0; i < cues.length; i++) { |
var cue = cues[i]; |
var expectedItem = expected[i]; |
- for (var property of properties) |
+ for (var property of Object.getOwnPropertyNames(expectedItem)) |
assert_equals(cue[property], expectedItem[property]); |
} |
+} |
+ |
+function check_cues_from_track(src, func) { |
+ async_test(function(t) { |
+ var video = document.createElement("video"); |
+ var trackElement = document.createElement("track"); |
+ trackElement.src = src; |
+ trackElement.default = true; |
+ video.appendChild(trackElement); |
+ |
+ trackElement.onload = t.step_func_done(function() { |
+ func(trackElement.track); |
+ }); |
+ }, "Check cues from " + src); |
} |