WebKit Bugzilla
Attachment 349940 Details for
Bug 189516
: MediaStream-MediaElement-srcObject.https.html expects video duration for a MediaStream to be Infinity and is currently NaN
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189516-20180917141516.patch (text/plain), 5.11 KB, created by
Wendy
on 2018-09-17 14:15:17 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wendy
Created:
2018-09-17 14:15:17 PDT
Size:
5.11 KB
patch
obsolete
>Subversion Revision: 235907 >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index b72cbedec2c093330071704516ece0aae8a52769..9959b3afc0dbd5aad36e6a396646fe922f1059a5 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,13 @@ >+2018-09-17 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 NOBODY (OOPS!). >+ >+ * web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html: >+ * web-platform-tests/resources/testharness.js: >+ > 2018-09-11 YUHAN WU <yuhan_wu@apple.com> > > Import media recorder api WPT tests >diff --git a/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html b/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html >index 63442bea25b34cda8814a22dc1e90a7871b4a0b9..eb801b86fc6441631e1f2d9e7647f51bce433f19 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html >+++ b/LayoutTests/imported/w3c/web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html >@@ -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_equals_epsilon(vid.played.end(0), vid.currentTime, "A MediaStream's timeline always consists of a single range", 0.0001); > 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_equals_epsilon(vid.currentTime, time, "The UA MUST ignore attempts to set the currentTime attribute", 0.0001); > // TODO add test that duration must be set to currentTime > // when mediastream is destroyed > vid.removeEventListener("timeupdate", testOncePlaying, false); >@@ -46,8 +45,8 @@ 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. "); >+ //assert_equals(vid.startDate, NaN, " A MediaStream does not specify a timeline offset"); > }), function(error) {}); > }); > </script> >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resources/testharness.js b/LayoutTests/imported/w3c/web-platform-tests/resources/testharness.js >index aa0d907559b6978cf4253b4323b1ba26dd4f1937..567c3c30f1ac9c2580d9a0cf131165a6f1b7a4ee 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resources/testharness.js >+++ b/LayoutTests/imported/w3c/web-platform-tests/resources/testharness.js >@@ -923,6 +923,32 @@ policies and contribution forms [3]. > return x === y; > } > >+ function same_value_float(x, y, epsilon) { >+ if (y !== y) { >+ // NaN case >+ return x !== x; >+ } >+ return Math.abs(x - y) < epsilon; >+ } >+ >+ function assert_equals_epsilon(actual, expected, description, epsilon) >+ { >+ /* >+ * Test if two floats are equal (under a certain epsilon) or two objects >+ * are the same object >+ */ >+ if (typeof actual != typeof expected) { >+ assert(false, "assert_equals", description, >+ "expected (" + typeof expected + ") ${expected} but got (" + typeof actual + ") ${actual}", >+ {expected:expected, actual:actual}); >+ return; >+ } >+ assert(same_value_float(actual, expected, epsilon), "assert_equals_epsilon", description, >+ "expected ${expected} but got ${actual}", >+ {expected:expected, actual:actual}); >+ } >+ expose(assert_equals_epsilon, "assert_equals_epsilon"); >+ > function assert_equals(actual, expected, description) > { > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189516
:
349938
|
349940
|
349948
|
349962
|
349963
|
349965
|
349966
|
349968
|
349972
|
349985
|
349989
|
350044
|
350084
|
350135