Flutter Engine
The Flutter Engine
post_task_sync.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/testing/post_task_sync.h"
6
7#include "flutter/fml/synchronization/waitable_event.h"
8
9namespace flutter {
10namespace testing {
11
13 const std::function<void()>& function) {
15 task_runner->PostTask([&] {
16 function();
17 latch.Signal();
18 });
19 latch.Wait();
20}
21
22} // namespace testing
23} // namespace flutter
virtual void PostTask(const fml::closure &task) override
Definition: task_runner.cc:24
Dart_NativeFunction function
Definition: fuchsia.cc:51
void PostTaskSync(const fml::RefPtr< fml::TaskRunner > &task_runner, const std::function< void()> &function)