Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
flutter::testing::ShellTestPlatformViewBuilder Class Reference

#include <shell_test_platform_view.h>

Classes

struct  Config
 

Public Member Functions

 ShellTestPlatformViewBuilder (Config config)
 
 ~ShellTestPlatformViewBuilder ()=default
 
std::unique_ptr< PlatformViewoperator() (Shell &shell)
 

Detailed Description

Definition at line 46 of file shell_test_platform_view.h.

Constructor & Destructor Documentation

◆ ShellTestPlatformViewBuilder()

flutter::testing::ShellTestPlatformViewBuilder::ShellTestPlatformViewBuilder ( Config  config)
explicit

Definition at line 60 of file shell_test_platform_view.cc.

61 : config_(std::move(config)) {}

◆ ~ShellTestPlatformViewBuilder()

flutter::testing::ShellTestPlatformViewBuilder::~ShellTestPlatformViewBuilder ( )
default

Member Function Documentation

◆ operator()()

std::unique_ptr< PlatformView > flutter::testing::ShellTestPlatformViewBuilder::operator() ( Shell shell)

Definition at line 63 of file shell_test_platform_view.cc.

64 {
65 const TaskRunners& task_runners = shell.GetTaskRunners();
66 const auto vsync_clock = std::make_shared<ShellTestVsyncClock>();
67 CreateVsyncWaiter create_vsync_waiter = [&task_runners, vsync_clock,
68 simulate_vsync =
69 config_.simulate_vsync]() {
70 if (simulate_vsync) {
71 return static_cast<std::unique_ptr<VsyncWaiter>>(
72 std::make_unique<ShellTestVsyncWaiter>(task_runners, vsync_clock));
73 } else {
74 return static_cast<std::unique_ptr<VsyncWaiter>>(
75 std::make_unique<VsyncWaiterFallback>(task_runners, true));
76 }
77 };
79 shell, //
80 task_runners, //
81 vsync_clock, //
82 create_vsync_waiter, //
83 config_.rendering_backend, //
85 shell.GetIsGpuDisabledSyncSwitch() //
86 );
87}
static std::unique_ptr< ShellTestPlatformView > Create(PlatformView::Delegate &delegate, const TaskRunners &task_runners, const std::shared_ptr< ShellTestVsyncClock > &vsync_clock, const CreateVsyncWaiter &create_vsync_waiter, BackendType backend, const std::shared_ptr< ShellTestExternalViewEmbedder > &shell_test_external_view_embedder, const std::shared_ptr< const fml::SyncSwitch > &is_gpu_disabled_sync_switch)
std::function< std::unique_ptr< VsyncWaiter >()> CreateVsyncWaiter
std::shared_ptr< ShellTestExternalViewEmbedder > shell_test_external_view_embedder

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