Bug 1293613: Update test using new manifest details. r?gerald
Do not assume that the element is still seeking when the seeking event is actually fired (the seeking operation is asynchronous)
MozReview-Commit-ID: Ap24kUQK8R2
--- a/testing/web-platform/tests/media-source/mediasource-seek-during-pending-seek.html
+++ b/testing/web-platform/tests/media-source/mediasource-seek-during-pending-seek.html
@@ -25,17 +25,17 @@
test.waitForExpectedEvents(function()
{
assert_false(mediaElement.seeking, 'mediaElement is not seeking');
assert_equals(mediaElement.readyState, mediaElement.HAVE_METADATA, 'Still in HAVE_METADATA');
// Seek to a new position before letting the initial seek to 0 completes.
test.expectEvent(mediaElement, 'seeking', 'mediaElement');
- mediaElement.currentTime = secondSegmentInfo.timecode;
+ mediaElement.currentTime = Math.max(secondSegmentInfo.timev, secondSegmentInfo.timea);
assert_true(mediaElement.seeking, 'mediaElement is seeking');
// Append media data for time 0.
test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
sourceBuffer.appendBuffer(firstSegment);
});
test.waitForExpectedEvents(function()
@@ -89,38 +89,39 @@
});
test.waitForExpectedEvents(function()
{
assert_greater_than(mediaElement.readyState, mediaElement.HAVE_CURRENT_DATA, 'Greater than HAVE_CURRENT_DATA');
// Seek to a new position.
test.expectEvent(mediaElement, 'seeking', 'mediaElement');
- mediaElement.currentTime = secondSegmentInfo.timecode;
+ mediaElement.currentTime = Math.max(secondSegmentInfo.timev, secondSegmentInfo.timea);
assert_true(mediaElement.seeking, 'mediaElement is seeking');
});
test.waitForExpectedEvents(function()
{
assert_true(mediaElement.seeking, 'mediaElement is still seeking');
// Seek to a second position while the first seek is still pending.
test.expectEvent(mediaElement, 'seeking', 'mediaElement');
- mediaElement.currentTime = thirdSegmentInfo.timecode;
+ mediaElement.currentTime = Math.max(thirdSegmentInfo.timev, thirdSegmentInfo.timea);
assert_true(mediaElement.seeking, 'mediaElement is seeking');
// Append media data for the first seek position.
test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
sourceBuffer.appendBuffer(secondSegment);
});
test.waitForExpectedEvents(function()
{
- assert_true(mediaElement.seeking, 'mediaElement is still seeking');
+ // Note that we can't assume that the element is still seeking
+ // when the seeking event is fired as the operation is asynchronous.
// Append media data for the second seek position.
test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer');
test.expectEvent(mediaElement, 'seeked', 'mediaElement finished seek');
MediaSourceUtil.appendUntilEventFires(test, mediaElement, 'seeked', sourceBuffer, mediaData, segmentInfo, segmentIndex);
});
test.waitForExpectedEvents(function()