Bug 1293613: Update test using new manifest details. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 10 Aug 2016 14:43:24 +1000
changeset 399477 f443d14ebdb69af1503788f481d130e842cd5244
parent 399476 e51fb05e733356cc2de7555793ae4319a0849822
child 399478 cb4aec06a8883d385c9fc3df4ec890b7fc18de8e
push id25846
push userbmo:jyavenard@mozilla.com
push dateThu, 11 Aug 2016 05:48:53 +0000
reviewersgerald
bugs1293613
milestone51.0a1
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
testing/web-platform/tests/media-source/mediasource-seek-during-pending-seek.html
--- 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()