7#include "flutter/common/task_runners.h"
8#include "flutter/fml/synchronization/waitable_event.h"
9#include "flutter/runtime/dart_vm.h"
10#include "flutter/shell/common/shell_test.h"
11#include "flutter/shell/common/thread_host.h"
12#include "flutter/testing/testing.h"
13#include "third_party/dart/runtime/include/dart_api.h"
23#define CHECK_DART_ERROR(name) \
24 EXPECT_FALSE(Dart_IsError(name)) << Dart_GetError(name)
27 auto settings = CreateSettingsForFixture();
36 auto message_latch = std::make_shared<fml::AutoResetWaitableEvent>();
38 std::unique_ptr<Shell>
shell = CreateShell(
settings, task_runners);
39 ASSERT_TRUE(
shell->IsSetup());
57 std::vector<Dart_Handle> hook_args;
58 for (
int i = 0; i < static_cast<int>(arg_count);
i++) {
69 message_latch->Signal();
75 configuration.SetEntrypoint(
"hooksTests");
77 shell->RunEngine(std::move(configuration), [](
auto result) {
81 message_latch->Wait();
82 DestroyShell(std::move(
shell), task_runners);
static RunConfiguration InferFromSettings(const Settings &settings, const fml::RefPtr< fml::TaskRunner > &io_worker=nullptr, IsolateLaunchType launch_type=IsolateLaunchType::kNewGroup)
Attempts to infer a run configuration from the settings object. This tries to create a run configurat...
DART_EXPORT Dart_Handle Dart_IntegerToInt64(Dart_Handle integer, int64_t *value)
struct _Dart_Handle * Dart_Handle
DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, int index)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_InvokeClosure(Dart_Handle closure, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url)
struct _Dart_NativeArguments * Dart_NativeArguments
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define CHECK_DART_ERROR(name)
fml::RefPtr< fml::TaskRunner > CreateNewThread(const std::string &name)
fml::RefPtr< fml::TaskRunner > GetCurrentTaskRunner()
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
TEST_F(DisplayListTest, Defaults)
Dart_Handle ToDart(const T &object)
#define CREATE_NATIVE_ENTRY(native_entry)