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

Unified Diff: mojo/edk/system/core_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/channel_endpoint.cc ('k') | mojo/edk/system/data_pipe_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/core_unittest.cc
diff --git a/mojo/edk/system/core_unittest.cc b/mojo/edk/system/core_unittest.cc
index 18f3fda72a587368bcbab71067a8624662ad8463..268aadbdf6ece126b65fd0c45da3fb66bae45c0d 100644
--- a/mojo/edk/system/core_unittest.cc
+++ b/mojo/edk/system/core_unittest.cc
@@ -8,11 +8,14 @@
#include <limits>
+#include "mojo/edk/platform/thread_utils.h"
#include "mojo/edk/system/awakable.h"
#include "mojo/edk/system/core_test_base.h"
-#include "mojo/edk/system/test/sleep.h"
+#include "mojo/edk/system/test/timeouts.h"
#include "mojo/public/cpp/system/macros.h"
+using mojo::platform::ThreadSleep;
+
namespace mojo {
namespace system {
namespace {
@@ -29,7 +32,7 @@ TEST_F(CoreTest, GetTimeTicksNow) {
const MojoTimeTicks start = core()->GetTimeTicksNow();
EXPECT_NE(static_cast<MojoTimeTicks>(0), start)
<< "GetTimeTicksNow should return nonzero value";
- test::SleepMilliseconds(15u);
+ ThreadSleep(test::DeadlineFromMilliseconds(15u));
const MojoTimeTicks finish = core()->GetTimeTicksNow();
// Allow for some fuzz in sleep.
EXPECT_GE((finish - start), static_cast<MojoTimeTicks>(8000))
« no previous file with comments | « mojo/edk/system/channel_endpoint.cc ('k') | mojo/edk/system/data_pipe_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698