Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::testing::FlutterWindowsEngineBuilder Class Reference

#include <flutter_windows_engine_builder.h>

Public Member Functions

 FlutterWindowsEngineBuilder (WindowsTestContext &context)
 
 ~FlutterWindowsEngineBuilder ()
 
void SetDartEntrypoint (std::string entrypoint)
 
void AddDartEntrypointArgument (std::string arg)
 
void SetCreateKeyboardHandlerCallbacks (KeyboardKeyEmbedderHandler::GetKeyStateHandler get_key_state, KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode map_vk_to_scan)
 
void SetSwitches (std::vector< std::string > switches)
 
void SetImpellerSwitch (FlutterDesktopImpellerSwitch impeller_switch)
 
void SetWindowsProcTable (std::shared_ptr< WindowsProcTable > windows_proc_table)
 
std::unique_ptr< FlutterWindowsEngineBuild ()
 

Detailed Description

Definition at line 19 of file flutter_windows_engine_builder.h.

Constructor & Destructor Documentation

◆ FlutterWindowsEngineBuilder()

flutter::testing::FlutterWindowsEngineBuilder::FlutterWindowsEngineBuilder ( WindowsTestContext context)
explicit

Definition at line 48 of file flutter_windows_engine_builder.cc.

50 : context_(context) {
51 properties_.assets_path = context.GetAssetsPath().c_str();
52 properties_.icu_data_path = context.GetIcuDataPath().c_str();
53 properties_.aot_library_path = context.GetAotLibraryPath().c_str();
54 properties_.impeller_switch = DefaultImpeller;
55}
@ DefaultImpeller
std::shared_ptr< ContextGLES > context
FlutterDesktopImpellerSwitch impeller_switch

References FlutterDesktopEngineProperties::aot_library_path, FlutterDesktopEngineProperties::assets_path, context, DefaultImpeller, FlutterDesktopEngineProperties::icu_data_path, and FlutterDesktopEngineProperties::impeller_switch.

◆ ~FlutterWindowsEngineBuilder()

flutter::testing::FlutterWindowsEngineBuilder::~FlutterWindowsEngineBuilder ( )
default

Member Function Documentation

◆ AddDartEntrypointArgument()

void flutter::testing::FlutterWindowsEngineBuilder::AddDartEntrypointArgument ( std::string  arg)

Definition at line 64 of file flutter_windows_engine_builder.cc.

64 {
65 dart_entrypoint_arguments_.emplace_back(std::move(arg));
66}

Referenced by flutter::testing::TEST_F().

◆ Build()

std::unique_ptr< FlutterWindowsEngine > flutter::testing::FlutterWindowsEngineBuilder::Build ( )

Definition at line 90 of file flutter_windows_engine_builder.cc.

90 {
91 std::vector<const char*> dart_args;
92 dart_args.reserve(dart_entrypoint_arguments_.size());
93
94 for (const auto& arg : dart_entrypoint_arguments_) {
95 dart_args.push_back(arg.c_str());
96 }
97
98 if (!dart_args.empty()) {
99 properties_.dart_entrypoint_argv = dart_args.data();
100 properties_.dart_entrypoint_argc = dart_args.size();
101 } else {
102 properties_.dart_entrypoint_argv = nullptr;
103 properties_.dart_entrypoint_argc = 0;
104 }
105
106 FlutterProjectBundle project(properties_);
107 project.SetSwitches(switches_);
108
109 return std::make_unique<TestFlutterWindowsEngine>(
110 project, get_key_state_, map_vk_to_scan_, std::move(windows_proc_table_));
111}

References FlutterDesktopEngineProperties::dart_entrypoint_argc, FlutterDesktopEngineProperties::dart_entrypoint_argv, and flutter::FlutterProjectBundle::SetSwitches().

Referenced by flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ SetCreateKeyboardHandlerCallbacks()

void flutter::testing::FlutterWindowsEngineBuilder::SetCreateKeyboardHandlerCallbacks ( KeyboardKeyEmbedderHandler::GetKeyStateHandler  get_key_state,
KeyboardKeyEmbedderHandler::MapVirtualKeyToScanCode  map_vk_to_scan 
)

Definition at line 78 of file flutter_windows_engine_builder.cc.

80 {
81 get_key_state_ = std::move(get_key_state);
82 map_vk_to_scan_ = std::move(map_vk_to_scan);
83}

◆ SetDartEntrypoint()

void flutter::testing::FlutterWindowsEngineBuilder::SetDartEntrypoint ( std::string  entrypoint)

◆ SetImpellerSwitch()

void flutter::testing::FlutterWindowsEngineBuilder::SetImpellerSwitch ( FlutterDesktopImpellerSwitch  impeller_switch)

◆ SetSwitches()

void flutter::testing::FlutterWindowsEngineBuilder::SetSwitches ( std::vector< std::string >  switches)

Definition at line 68 of file flutter_windows_engine_builder.cc.

69 {
70 switches_ = std::move(switches);
71}

Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().

◆ SetWindowsProcTable()

void flutter::testing::FlutterWindowsEngineBuilder::SetWindowsProcTable ( std::shared_ptr< WindowsProcTable windows_proc_table)

Definition at line 85 of file flutter_windows_engine_builder.cc.

86 {
87 windows_proc_table_ = std::move(windows_proc_table);
88}

Referenced by flutter::testing::TEST_F().


The documentation for this class was generated from the following files: