Index: mojo/edk/system/waiter_unittest.cc |
diff --git a/mojo/edk/system/waiter_unittest.cc b/mojo/edk/system/waiter_unittest.cc |
index 9a344f5a1161739b856e3da51bd0829b7876412a..c5c10d968c478dc2f524884be6d9e95999d4d0d7 100644 |
--- a/mojo/edk/system/waiter_unittest.cc |
+++ b/mojo/edk/system/waiter_unittest.cc |
@@ -11,14 +11,15 @@ |
#include <stdint.h> |
+#include "mojo/edk/platform/thread_utils.h" |
#include "mojo/edk/system/test/simple_test_thread.h" |
-#include "mojo/edk/system/test/sleep.h" |
#include "mojo/edk/system/test/stopwatch.h" |
#include "mojo/edk/system/test/timeouts.h" |
#include "mojo/edk/util/mutex.h" |
#include "mojo/public/cpp/system/macros.h" |
#include "testing/gtest/include/gtest/gtest.h" |
+using mojo::platform::ThreadSleep; |
using mojo::util::Mutex; |
using mojo::util::MutexLocker; |
@@ -54,7 +55,7 @@ class WaitingThread : public test::SimpleTestThread { |
} |
} |
- test::SleepMilliseconds(kPollTimeMs); |
+ ThreadSleep(test::DeadlineFromMilliseconds(kPollTimeMs)); |
} |
} |
@@ -125,7 +126,7 @@ TEST(WaiterTest, Basic) { |
{ |
WaitingThread thread(10 * test::EpsilonTimeout()); |
thread.Start(); |
- test::Sleep(2 * test::EpsilonTimeout()); |
+ ThreadSleep(2 * test::EpsilonTimeout()); |
thread.waiter()->Awake(1, 3); |
thread.WaitUntilDone(&result, &context, &elapsed); |
EXPECT_EQ(1u, result); |
@@ -138,7 +139,7 @@ TEST(WaiterTest, Basic) { |
{ |
WaitingThread thread(10 * test::EpsilonTimeout()); |
thread.Start(); |
- test::Sleep(5 * test::EpsilonTimeout()); |
+ ThreadSleep(5 * test::EpsilonTimeout()); |
thread.waiter()->Awake(2, 4); |
thread.WaitUntilDone(&result, &context, &elapsed); |
EXPECT_EQ(2u, result); |
@@ -186,7 +187,7 @@ TEST(WaiterTest, Basic) { |
{ |
WaitingThread thread(MOJO_DEADLINE_INDEFINITE); |
thread.Start(); |
- test::Sleep(2 * test::EpsilonTimeout()); |
+ ThreadSleep(2 * test::EpsilonTimeout()); |
thread.waiter()->Awake(1, 7); |
thread.WaitUntilDone(&result, &context, &elapsed); |
EXPECT_EQ(1u, result); |
@@ -199,7 +200,7 @@ TEST(WaiterTest, Basic) { |
{ |
WaitingThread thread(MOJO_DEADLINE_INDEFINITE); |
thread.Start(); |
- test::Sleep(5 * test::EpsilonTimeout()); |
+ ThreadSleep(5 * test::EpsilonTimeout()); |
thread.waiter()->Awake(2, 8); |
thread.WaitUntilDone(&result, &context, &elapsed); |
EXPECT_EQ(2u, result); |
@@ -274,7 +275,7 @@ TEST(WaiterTest, MultipleAwakes) { |
WaitingThread thread(MOJO_DEADLINE_INDEFINITE); |
thread.Start(); |
thread.waiter()->Awake(10, 5); |
- test::Sleep(2 * test::EpsilonTimeout()); |
+ ThreadSleep(2 * test::EpsilonTimeout()); |
thread.waiter()->Awake(20, 6); |
thread.WaitUntilDone(&result, &context, &elapsed); |
EXPECT_EQ(10u, result); |
@@ -285,9 +286,9 @@ TEST(WaiterTest, MultipleAwakes) { |
{ |
WaitingThread thread(10 * test::EpsilonTimeout()); |
thread.Start(); |
- test::Sleep(1 * test::EpsilonTimeout()); |
+ ThreadSleep(1 * test::EpsilonTimeout()); |
thread.waiter()->Awake(MOJO_RESULT_FAILED_PRECONDITION, 7); |
- test::Sleep(2 * test::EpsilonTimeout()); |
+ ThreadSleep(2 * test::EpsilonTimeout()); |
thread.waiter()->Awake(MOJO_RESULT_OK, 8); |
thread.WaitUntilDone(&result, &context, &elapsed); |
EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, result); |