summaryrefslogtreecommitdiffstats
path: root/dom/media/gtest/TestMediaQueue.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/media/gtest/TestMediaQueue.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/gtest/TestMediaQueue.cpp')
-rw-r--r--dom/media/gtest/TestMediaQueue.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/dom/media/gtest/TestMediaQueue.cpp b/dom/media/gtest/TestMediaQueue.cpp
index 5b049dc7fe..7176de069f 100644
--- a/dom/media/gtest/TestMediaQueue.cpp
+++ b/dom/media/gtest/TestMediaQueue.cpp
@@ -6,6 +6,7 @@
#include "MediaData.h"
#include "MediaQueue.h"
+#include "nsISupportsImpl.h"
using namespace mozilla;
using mozilla::media::TimeUnit;
@@ -285,4 +286,19 @@ TEST(MediaQueue, TimestampAdjustmentForNotSupportDataType)
EXPECT_EQ(data->GetEndTime(), TimeUnit::FromMicroseconds(10));
}
+TEST(MediaQueue, PreciseDuration)
+{
+ MediaQueue<MediaData> queueOff;
+ queueOff.Push(CreateDataRawPtr(5, 10));
+ queueOff.Push(CreateDataRawPtr(0, 5));
+ EXPECT_EQ(queueOff.Duration(), 0);
+ EXPECT_EQ(queueOff.PreciseDuration(), -1);
+
+ MediaQueue<MediaData> queueOn(true /* aEnablePreciseDuration */);
+ queueOn.Push(CreateDataRawPtr(5, 10));
+ queueOn.Push(CreateDataRawPtr(0, 5));
+ EXPECT_EQ(queueOn.Duration(), 0);
+ EXPECT_EQ(queueOn.PreciseDuration(), 10);
+}
+
#undef EXPECT_EQUAL_SIZE_T