#include "base/test/run_until.h"
#include "base/functional/callback_forward.h"
#include "base/functional/callback_helpers.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "base/timer/timer.h"
#include "testing/gtest/include/gtest/gtest-spi.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base::test {
namespace {
template <typename Lambda>
void RunLater(Lambda lambda) { … }
void PostDelayedTask(base::OnceClosure closure, base::TimeDelta delay) { … }
}
class RunUntilTest : public ::testing::Test { … };
TEST_F(RunUntilTest, ShouldReturnTrueIfPredicateIsAlreadyFulfilled) { … }
TEST_F(RunUntilTest, ShouldReturnTrueOncePredicateIsFulfilled) { … }
TEST_F(RunUntilTest, ShouldNotSimplyActivelyInvokePredicateInALoop) { … }
TEST_F(RunUntilTest, ShouldNotSimplyReturnOnFirstIdle) { … }
TEST_F(RunUntilTest,
ShouldAlwaysLetOtherTasksRunFirstEvenIfPredicateIsAlreadyFulfilled) { … }
TEST_F(RunUntilTest, ShouldWorkEvenWhenTimerIsRunning) { … }
TEST_F(RunUntilTest, ShouldReturnFalseIfTimeoutHappens) { … }
}