diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/rtc_base/task_queue_unittest.cc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | third_party/libwebrtc/rtc_base/task_queue_unittest.cc | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/third_party/libwebrtc/rtc_base/task_queue_unittest.cc b/third_party/libwebrtc/rtc_base/task_queue_unittest.cc index 579dc3cced..eb5c5b16fb 100644 --- a/third_party/libwebrtc/rtc_base/task_queue_unittest.cc +++ b/third_party/libwebrtc/rtc_base/task_queue_unittest.cc @@ -28,10 +28,10 @@ #include "rtc_base/time_utils.h" #include "test/gtest.h" -namespace rtc { +namespace webrtc { namespace { -using ::webrtc::TimeDelta; + // Noop on all platforms except Windows, where it turns on high precision // multimedia timers which increases the precision of TimeMillis() while in // scope. @@ -51,12 +51,6 @@ class EnableHighResTimers { #endif }; -void CheckCurrent(Event* signal, TaskQueue* queue) { - EXPECT_TRUE(queue->IsCurrent()); - if (signal) - signal->Set(); -} - } // namespace // This task needs to be run manually due to the slowness of some of our bots. @@ -65,14 +59,18 @@ TEST(TaskQueueTest, DISABLED_PostDelayedHighRes) { EnableHighResTimers high_res_scope; static const char kQueueName[] = "PostDelayedHighRes"; - Event event; - webrtc::TaskQueueForTest queue(kQueueName, TaskQueue::Priority::HIGH); + rtc::Event event; + TaskQueueForTest queue(kQueueName, TaskQueueFactory::Priority::HIGH); - uint32_t start = Time(); - queue.PostDelayedTask([&event, &queue] { CheckCurrent(&event, &queue); }, - TimeDelta::Millis(3)); - EXPECT_TRUE(event.Wait(webrtc::TimeDelta::Seconds(1))); - uint32_t end = TimeMillis(); + uint32_t start = rtc::TimeMillis(); + queue.PostDelayedTask( + [&event, &queue] { + EXPECT_TRUE(queue.IsCurrent()); + event.Set(); + }, + TimeDelta::Millis(3)); + EXPECT_TRUE(event.Wait(TimeDelta::Seconds(1))); + uint32_t end = rtc::TimeMillis(); // These tests are a little relaxed due to how "powerful" our test bots can // be. Most recently we've seen windows bots fire the callback after 94-99ms, // which is why we have a little bit of leeway backwards as well. @@ -80,4 +78,4 @@ TEST(TaskQueueTest, DISABLED_PostDelayedHighRes) { EXPECT_NEAR(end - start, 3, 3u); } -} // namespace rtc +} // namespace webrtc |