MediaStream-MediaElement-srcObject.https.html expects video duration for a MediaStrea...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Sep 2018 23:58:33 +0000 (23:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Sep 2018 23:58:33 +0000 (23:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189516

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-09-19
Reviewed by Youenn Fablet.

* web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html:
* web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236231 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html

index f96cdd6..bed9f05 100644 (file)
@@ -1,3 +1,13 @@
+2018-09-19  YUHAN WU  <yuhan_wu@apple.com>
+
+        MediaStream-MediaElement-srcObject.https.html expects video duration for a MediaStream to be Infinity and is currently NaN
+        https://bugs.webkit.org/show_bug.cgi?id=189516
+
+        Reviewed by Youenn Fablet.
+
+        * web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html:
+        * web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https-expected.txt:
+
 2018-09-19  Youenn Fablet  <youenn@apple.com>
 
         Implement sender/receiver getStats
index c6b8424..812fefd 100644 (file)
@@ -6,5 +6,5 @@ This test checks that the MediaStream object returned by the success callback in
 
 
 
-FAIL Tests that a MediaStream can be assigned to a video element with srcObject assert_equals:  A MediaStream does not have a pre-defined duration.  expected Infinity but got NaN
+PASS Tests that a MediaStream can be assigned to a video element with srcObject 
 
index 63442be..2ed96ec 100644 (file)
@@ -26,13 +26,12 @@ t.step(function() {
       var testOncePlaying = function() {
          assert_equals(vid.played.length, 1, "A MediaStream's timeline always consists of a single range");
          assert_equals(vid.played.start(0), 0, "A MediaStream's timeline always consists of a single range");
-         assert_equals(vid.played.end(0), vid.currentTime, "A MediaStream's timeline always consists of a single range");
+         assert_approx_equals(vid.played.end(0), vid.currentTime, 0.0001, "A MediaStream's timeline always consists of a single range");
          assert_equals(vid.readyState, vid.HAVE_ENOUGH_DATA, "Upon selecting a media stream, the UA sets readyState to HAVE_ENOUGH_DATA");
+         assert_equals(vid.duration, Infinity, " A MediaStream does not have a pre-defined duration. ");
          var time = vid.currentTime;
-         assert_throws("INVALID_STATE_ERR", function() {
-            vid.currentTime = 0;
-         });
-         assert_equals(vid.currentTime, time, "The UA MUST ignore attempts to set the currentTime attribute");
+
+         assert_approx_equals(vid.currentTime, time, 0.0001, "The UA MUST ignore attempts to set the currentTime attribute");
          // TODO add test that duration must be set to currentTime
          // when mediastream is destroyed
          vid.removeEventListener("timeupdate", testOncePlaying, false);
@@ -46,8 +45,7 @@ t.step(function() {
       assert_equals(vid.defaultPlaybackRate, 1, "playback rate is always 1");
       assert_equals(vid.playbackRate, 1, "playback rate is always 1");
       assert_equals(vid.buffered.length, 0, "A MediaStream cannot be preloaded.  Therefore, there is no buffered timeranges");
-      assert_equals(vid.duration, Infinity, " A MediaStream does not have a pre-defined duration. ");
-      assert_equals(vid.startDate, NaN, " A MediaStream does not specify a timeline offset");
+      assert_equals(vid.duration, vid.readyState == vid.HAVE_NOTHING ? NaN : Infinity, " A MediaStream does not have a pre-defined duration. ");
     }), function(error) {});
 });
 </script>