Bug 1398139 - part3 : check current time should be increased correctly in new chained part.
MozReview-Commit-ID: 3ctF8SAVcs9
--- a/dom/media/test/test_chaining.html
+++ b/dom/media/test/test_chaining.html
@@ -53,16 +53,20 @@ function onmetadataloaded(e) {
}
// We should be able to assert equality here, but somehow it fails (rarely but
// still) on try. Instead, we give it a little slack and assert that the index
// increases monotonically.
ok(t.mozGetMetadata().index >= t._metadataCount || t._links === 1,
"The metadata index value should increase." + t.src);
+ ok(t.currentTime >= t._prevCurrentTime,
+ "The currenttime should be increased correctly in new chained part.");
+ t._prevCurrentTime = t.currentTime;
+
// The files have all a user comment name 'index' that increments at each link
// in the chained media.
t._metadataCount++;
if (!t.playing && !t.ended) {
t.play();
}
}
@@ -73,15 +77,16 @@ function startTest(test, token) {
manager.started(token);
element._links= test.links;
element.src = test.name;
element.token = token;
element.controls = true;
element.addEventListener("loadedmetadata", onmetadataloaded);
element.addEventListener("ended", onended);
element.preload = "metadata";
+ element._prevCurrentTime = 0;
}
manager.runTests(gChainingTests, startTest);
</script>
</pre>
</body>
</html>