Flutter Engine
flutter::testing::ImageDisposeTest Class Reference
Inheritance diagram for flutter::testing::ImageDisposeTest:
flutter::testing::ShellTest flutter::testing::FixtureTest flutter::testing::ThreadTest

Public Member Functions

template<class T >
T * GetNativePeer (Dart_Handle handle)
 
- Public Member Functions inherited from flutter::testing::ShellTest
 ShellTest ()
 
Settings CreateSettingsForFixture () override
 
std::unique_ptr< ShellCreateShell (Settings settings, bool simulate_vsync=false)
 
std::unique_ptr< ShellCreateShell (Settings settings, TaskRunners task_runners, bool simulate_vsync=false, std::shared_ptr< ShellTestExternalViewEmbedder > shell_test_external_view_embedder=nullptr)
 
void DestroyShell (std::unique_ptr< Shell > shell)
 
void DestroyShell (std::unique_ptr< Shell > shell, TaskRunners task_runners)
 
TaskRunners GetTaskRunnersForFixture ()
 
fml::TimePoint GetLatestFrameTargetTime (Shell *shell) const
 
void SendEnginePlatformMessage (Shell *shell, fml::RefPtr< PlatformMessage > message)
 
std::shared_ptr< txt::FontCollectionGetFontCollection (Shell *shell)
 
- Public Member Functions inherited from flutter::testing::FixtureTest
 FixtureTest ()
 
void AddNativeCallback (std::string name, Dart_NativeFunction callback)
 
- Public Member Functions inherited from flutter::testing::ThreadTest
 ThreadTest ()
 
fml::RefPtr< fml::TaskRunnerGetCurrentTaskRunner ()
 Get the task runner for the thread that the current unit-test is running on. This creates a message loop as necessary. More...
 
fml::RefPtr< fml::TaskRunnerCreateNewThread (std::string name="")
 Creates a new thread, initializes a message loop on it, and, returns its task runner to the unit-test. The message loop is terminated (and its thread joined) when the test ends. This allows tests to create multiple named threads as necessary. More...
 

Static Public Member Functions

static void picture_finalizer (void *isolate_callback_data, void *peer)
 
- Static Public Member Functions inherited from flutter::testing::ShellTest
static void PlatformViewNotifyCreated (Shell *shell)
 
static void PlatformViewNotifyDestroyed (Shell *shell)
 
static void RunEngine (Shell *shell, RunConfiguration configuration)
 
static void RestartEngine (Shell *shell, RunConfiguration configuration)
 
static void VSyncFlush (Shell *shell, bool &will_draw_new_frame)
 
static void SetViewportMetrics (Shell *shell, double width, double height)
 
static void NotifyIdle (Shell *shell, int64_t deadline)
 
static void PumpOneFrame (Shell *shell, double width=1, double height=1, LayerTreeBuilder={})
 
static void PumpOneFrame (Shell *shell, flutter::ViewportMetrics viewport_metrics, LayerTreeBuilder={})
 
static void DispatchFakePointerData (Shell *shell)
 
static void DispatchPointerData (Shell *shell, std::unique_ptr< PointerDataPacket > packet)
 
static bool GetNeedsReportTimings (Shell *shell)
 
static void SetNeedsReportTimings (Shell *shell, bool value)
 
static void StorePersistentCache (PersistentCache *cache, const SkData &key, const SkData &value)
 
static void OnServiceProtocol (Shell *shell, ServiceProtocolEnum some_protocol, fml::RefPtr< fml::TaskRunner > task_runner, const ServiceProtocol::Handler::ServiceProtocolMap &params, rapidjson::Document *response)
 
static int UnreportedTimingsCount (Shell *shell)
 

Public Attributes

fml::AutoResetWaitableEvent message_latch_
 
fml::AutoResetWaitableEvent picture_finalizer_latch_
 
sk_sp< SkPicture > current_picture_
 
sk_sp< SkImage > current_image_
 

Additional Inherited Members

- Public Types inherited from flutter::testing::ShellTest
enum  ServiceProtocolEnum {
  kGetSkSLs,
  kEstimateRasterCacheMemory,
  kSetAssetBundlePath,
  kRunInView
}
 
using LayerTreeBuilder = std::function< void(std::shared_ptr< ContainerLayer > root)>
 
- Protected Member Functions inherited from flutter::testing::FixtureTest
void SetSnapshotsAndAssets (Settings &settings)
 
- Protected Attributes inherited from flutter::testing::FixtureTest
std::shared_ptr< TestDartNativeResolvernative_resolver_
 

Detailed Description

Definition at line 19 of file image_dispose_unittests.cc.

Member Function Documentation

◆ GetNativePeer()

template<class T >
T* flutter::testing::ImageDisposeTest::GetNativePeer ( Dart_Handle  handle)
inline

Definition at line 22 of file image_dispose_unittests.cc.

References tonic::DartWrappable::kPeerIndex.

22  {
23  intptr_t peer = 0;
24  auto native_handle = Dart_GetNativeInstanceField(
25  handle, tonic::DartWrappable::kPeerIndex, &peer);
26  EXPECT_FALSE(Dart_IsError(native_handle)) << Dart_GetError(native_handle);
27  return reinterpret_cast<T*>(peer);
28  }

◆ picture_finalizer()

static void flutter::testing::ImageDisposeTest::picture_finalizer ( void *  isolate_callback_data,
void *  peer 
)
inlinestatic

Definition at line 34 of file image_dispose_unittests.cc.

References fml::AutoResetWaitableEvent::Signal().

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

34  {
35  auto latch = reinterpret_cast<fml::AutoResetWaitableEvent*>(peer);
36  latch->Signal();
37  }

Member Data Documentation

◆ current_image_

sk_sp<SkImage> flutter::testing::ImageDisposeTest::current_image_

Definition at line 40 of file image_dispose_unittests.cc.

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

◆ current_picture_

sk_sp<SkPicture> flutter::testing::ImageDisposeTest::current_picture_

Definition at line 39 of file image_dispose_unittests.cc.

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

◆ message_latch_

fml::AutoResetWaitableEvent flutter::testing::ImageDisposeTest::message_latch_

Definition at line 31 of file image_dispose_unittests.cc.

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

◆ picture_finalizer_latch_

fml::AutoResetWaitableEvent flutter::testing::ImageDisposeTest::picture_finalizer_latch_

Definition at line 33 of file image_dispose_unittests.cc.

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


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