5#include "flutter/fml/synchronization/count_down_latch.h"
10#include "flutter/fml/build_config.h"
11#include "flutter/fml/thread.h"
12#include "flutter/testing/testing.h"
16TEST(CountDownLatchTest, CanWaitOnZero) {
21TEST(CountDownLatchTest, CanWait) {
23 const size_t count = 100;
24 size_t current_count = 0;
26 auto decrement_latch_on_thread = [runner = thread.
GetTaskRunner(), &latch,
28 runner->PostTask([&latch, ¤t_count]() {
29 std::this_thread::sleep_for(std::chrono::microseconds(100));
35 decrement_latch_on_thread();
38 ASSERT_EQ(current_count,
count);
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
TEST(MallocMapping, EmptyContructor)