Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1301)

Unified Diff: mojo/edk/util/cond_var_unittest.cc

Issue 1639093002: Add //mojo/edk/platform/thread_utils.* containing "yield" and "sleep". (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/waiter_unittest.cc ('k') | mojo/edk/util/mutex_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/util/cond_var_unittest.cc
diff --git a/mojo/edk/util/cond_var_unittest.cc b/mojo/edk/util/cond_var_unittest.cc
index ab966f1ba3a332eed6934ddab7c64e38f3b73a2a..4361a7386d1fd5f2d970c6942cb3b8507aa92e9b 100644
--- a/mojo/edk/util/cond_var_unittest.cc
+++ b/mojo/edk/util/cond_var_unittest.cc
@@ -11,16 +11,16 @@
#include <type_traits>
#include <vector>
-#include "mojo/edk/system/test/sleep.h"
+#include "mojo/edk/platform/thread_utils.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::system::test::DeadlineFromMilliseconds;
using mojo::system::test::EpsilonTimeout;
-using mojo::system::test::SleepMilliseconds;
using mojo::system::test::Stopwatch;
using mojo::system::test::TinyTimeout;
@@ -30,7 +30,7 @@ namespace {
// Sleeps for a "very small" amount of time.
void EpsilonRandomSleep() {
- SleepMilliseconds(static_cast<unsigned>(rand()) % 20u);
+ ThreadSleep(DeadlineFromMilliseconds(static_cast<unsigned>(rand()) % 20u));
}
// We'll use |MojoDeadline| with |uint64_t| (for |CondVar::WaitWithTimeout()|'s
« no previous file with comments | « mojo/edk/system/waiter_unittest.cc ('k') | mojo/edk/util/mutex_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698