[MSE][WTF][Media] Invalid MediaTime should be falsy
authoraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Oct 2018 14:05:25 +0000 (14:05 +0000)
committeraboya@igalia.com <aboya@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Oct 2018 14:05:25 +0000 (14:05 +0000)
commit1581c602232f2039d6147a03aee7fab7cc47d377
tree5dbd09b004aa82f8af505465725418ff6eeb82a7
parent7af87a2549eb71b52fe23f4fd46e72fa3fad271f
[MSE][WTF][Media] Invalid MediaTime should be falsy
https://bugs.webkit.org/show_bug.cgi?id=190893

Reviewed by Jer Noble.

Source/WTF:

This patch modifies the definition of MediaTime so that invalid times
are evaluated to false in the context of a boolean expression.

* wtf/MediaTime.cpp:
(WTF::MediaTime::operator! const):
(WTF::MediaTime::operator bool const):

Tools:

This patch adds additional API tests for the conversions from
MediaTime to boolean.

* TestWebKitAPI/Tests/WTF/MediaTime.cpp:
(TestWebKitAPI::TEST):

LayoutTests:

A test is added that replicates a bug fixed by this patch.

* media/media-source/media-source-timestampoffset-then-zero-expected.txt: Added.
* media/media-source/media-source-timestampoffset-then-zero.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/media-source/media-source-timestampoffset-then-zero-expected.txt [new file with mode: 0644]
LayoutTests/media/media-source/media-source-timestampoffset-then-zero.html [new file with mode: 0644]
Source/WTF/ChangeLog
Source/WTF/wtf/MediaTime.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp