Give the post-and-reply worker pool test a chance to finish on iOS

Since some iOS devices are single-core, a busy loop on one thread can
starve the thread that the test is waiting for to finish.

BUG=None
TEST=None


Review URL: https://chromiumcodereview.appspot.com/10810061

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148087 0039d316-1c4b-4281-b951-d872f2087c98
parent 9ad8d30e
......@@ -98,6 +98,11 @@ TEST_F(WorkerPoolTest, MAYBE_PostTaskAndReply) {
const TimeDelta kMaxDuration = TestTimeouts::tiny_timeout();
TimeTicks start = TimeTicks::Now();
while (!tester->finished() && TimeTicks::Now() - start < kMaxDuration) {
#if defined(OS_IOS)
// Ensure that the other thread has a chance to run even on a single-core
// device.
pthread_yield_np();
#endif
MessageLoop::current()->RunAllPending();
}
EXPECT_TRUE(tester->finished());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment