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

Unified Diff: mojo/edk/system/message_pipe_dispatcher_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/data_pipe_impl_unittest.cc ('k') | mojo/edk/system/message_pipe_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/message_pipe_dispatcher_unittest.cc
diff --git a/mojo/edk/system/message_pipe_dispatcher_unittest.cc b/mojo/edk/system/message_pipe_dispatcher_unittest.cc
index 168ca5de87f02b76aa7ca72602f2c67493baaf78..1a4d6fe42f0264494da8576e0b35b83644f212b1 100644
--- a/mojo/edk/system/message_pipe_dispatcher_unittest.cc
+++ b/mojo/edk/system/message_pipe_dispatcher_unittest.cc
@@ -16,10 +16,10 @@
#include <utility>
#include <vector>
+#include "mojo/edk/platform/thread_utils.h"
#include "mojo/edk/system/message_pipe.h"
#include "mojo/edk/system/test/random.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/system/waiter.h"
@@ -29,6 +29,7 @@
#include "mojo/public/cpp/system/macros.h"
#include "testing/gtest/include/gtest/gtest.h"
+using mojo::platform::ThreadSleep;
using mojo::util::MakeUnique;
using mojo::util::RefPtr;
@@ -377,7 +378,7 @@ TEST(MessagePipeDispatcherTest, BasicThreaded) {
&context, &hss);
stopwatch.Start();
thread.Start();
- test::Sleep(2 * test::EpsilonTimeout());
+ ThreadSleep(2 * test::EpsilonTimeout());
// Wake it up by writing to |d0|.
buffer[0] = 123456789;
EXPECT_EQ(MOJO_RESULT_OK,
@@ -427,7 +428,7 @@ TEST(MessagePipeDispatcherTest, BasicThreaded) {
&context, &hss);
stopwatch.Start();
thread.Start();
- test::Sleep(2 * test::EpsilonTimeout());
+ ThreadSleep(2 * test::EpsilonTimeout());
EXPECT_EQ(MOJO_RESULT_OK, d0->Close());
} // Joins the thread.
elapsed = stopwatch.Elapsed();
@@ -461,7 +462,7 @@ TEST(MessagePipeDispatcherTest, BasicThreaded) {
&context, &hss);
stopwatch.Start();
thread.Start();
- test::Sleep(2 * test::EpsilonTimeout());
+ ThreadSleep(2 * test::EpsilonTimeout());
EXPECT_EQ(MOJO_RESULT_OK, d1->Close());
} // Joins the thread.
elapsed = stopwatch.Elapsed();
« no previous file with comments | « mojo/edk/system/data_pipe_impl_unittest.cc ('k') | mojo/edk/system/message_pipe_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698