Flutter Engine
flutter::testing Namespace Reference

Namespaces

 keycodes
 

Classes

struct  AOTDataDeleter
 
class  AutoIsolateShutdown
 
class  BoundsTolerance
 
class  CanvasCompareTester
 
class  CanvasTestBase
 
class  ConstantFiringVsyncWaiter
 
class  DartFixture
 
class  DartIsolateTest
 
class  DartNativeBenchmarks
 
class  DartPersistentHandleTest
 
class  DartSecondaryIsolateTest
 
class  DartWeakPersistentHandle
 
class  DarwinContextMetal
 
struct  DisplayListInvocation
 
struct  DisplayListInvocationGroup
 
class  DummyPlatformConfigurationClient
 
struct  ELFAOTSymbols
 
class  EmbedderConfigBuilder
 
class  EmbedderTest
 
class  EmbedderTestBackingStoreProducer
 
class  EmbedderTestCompositor
 
class  EmbedderTestCompositorGL
 
class  EmbedderTestCompositorMetal
 
class  EmbedderTestCompositorSoftware
 
class  EmbedderTestContext
 
class  EmbedderTestContextGL
 
class  EmbedderTestContextMetal
 
class  EmbedderTestContextSoftware
 
class  EmbedderTestTaskRunner
 A task runner that we expect the embedder to provide but whose implementation is a real FML task runner. More...
 
class  FakeAnimatorDelegate
 
class  FakeImageGenerator
 
class  FixtureTest
 
class  FlutterEngineTest
 
class  FlutterWindowWin32Test
 Test class for FlutterWindowWin32. More...
 
class  FuchsiaShellTest
 
class  GLContextSwitchTest
 
class  ImageDecoderFixtureTest
 
class  ImageDisposeTest
 
struct  KeyEventUserData
 
class  LayerTestBase
 
class  LayerTreeTest
 
struct  LoadedELFDeleter
 
class  MockCanvas
 
class  MockGlFunctions
 
class  MockLayer
 
class  MockMessageQueue
 
class  MockRasterCache
 A RasterCache implementation that simulates the act of rendering a Layer or SkPicture without the overhead of rasterization or pixel storage. This implementation is used only for testing proper usage of the RasterCache in layer unit tests. More...
 
class  MockRasterCacheResult
 A RasterCacheResult implementation that represents a cached Layer or SkPicture without the overhead of storage. More...
 
class  MockSyncSwitch
 
class  MockTexture
 
class  MockViewEmbedder
 
class  MockWin32Window
 Mock for the |WindowWin32| base class. More...
 
class  MockWindowBindingHandler
 Mock for the |WindowWin32| base class. More...
 
class  PendingTests
 
struct  PrerollContextHolder
 
class  ScopedStubFlutterApi
 
class  ScopedStubFlutterGlfwApi
 
class  ScopedStubFlutterWindowsApi
 
class  ShellTest
 
class  ShellTestPlatformView
 
class  ShellTestPlatformViewGL
 
class  ShellTestPlatformViewMetal
 
class  ShellTestPlatformViewVulkan
 
class  ShellTestVsyncClock
 
class  ShellTestVsyncWaiter
 
class  SinglePixelImageGenerator
 An image generator that always creates a 1x1 single-frame green image. More...
 
class  SkiaGPUObjectLayerTest
 
class  SkiaGpuObjectTest
 
class  StubFlutterApi
 
class  StubFlutterGlfwApi
 
class  StubFlutterWindowsApi
 
class  SurfaceMock
 
class  TestAndroidSurfaceFactory
 
class  TestAssetResolver
 
class  TestDartNativeResolver
 
class  TestGLSurface
 
class  TestIOManager
 
class  TestSkObject
 
class  TestSwitchableGLContext
 The renderer context used for testing. More...
 
class  TestTimeoutListener
 
class  ThreadTest
 A fixture that creates threads with running message loops that are terminated when the test is done (the threads are joined then as well). While this fixture may be used on it's own, it is often sub-classed by other fixtures whose functioning requires threads to be created as necessary. More...
 
class  TypeConversionsTest
 
struct  UniqueEngineTraits
 
class  UnknownImageGenerator
 An Image generator that pretends it can't recognize the data it was given. More...
 
struct  Win32Message
 
struct  WmCharInfo
 
struct  WmDeadCharInfo
 
struct  WmKeyDownInfo
 
struct  WmKeyUpInfo
 
struct  WmSysKeyUpInfo
 

Typedefs

typedef const std::function< void(DisplayListBuilder &)> DlInvoker
 
using BackdropFilterLayerTest = LayerTest
 
using CheckerBoardLayerTest = LayerTest
 
using ClipPathLayerTest = LayerTest
 
using ClipRectLayerTest = LayerTest
 
using ClipRRectLayerTest = LayerTest
 
using ColorFilterLayerTest = LayerTest
 
using ContainerLayerTest = LayerTest
 
using DisplayListLayerTest = SkiaGPUObjectLayerTest
 
using ImageFilterLayerTest = LayerTest
 
using OpacityLayerTest = LayerTest
 
using PerformanceOverlayLayerTest = LayerTest
 
using PhysicalShapeLayerTest = LayerTest
 
using PictureLayerTest = SkiaGPUObjectLayerTest
 
using PlatformViewLayerTest = LayerTest
 
using ShaderMaskLayerTest = LayerTest
 
using TextureLayerTest = LayerTest
 
using TransformLayerTest = LayerTest
 
using AutoSaveLayerTests = LayerTest
 
using LayerTest = LayerTestBase<::testing::Test >
 
using MockLayerTest = LayerTest
 
using HooksTest = ShellTest
 
using SemanticsUpdateBuilderTest = ShellTest
 
using DartLifecycleTest = FixtureTest
 
using DartVMTest = FixtureTest
 
using UnitlessTime = int
 
using Generator = std::function< UnitlessTime(int)>
 
using PersistentCacheTest = ShellTest
 
using IntPipeline = Pipeline< int >
 
using Continuation = IntPipeline::ProducerContinuation
 
using CreateVsyncWaiter = std::function< std::unique_ptr< VsyncWaiter >()>
 
using Embedder11yTest = testing::EmbedderTest
 
using UniqueEngine = fml::UniqueObject< FlutterEngine, UniqueEngineTraits >
 
using SemanticsNodeCallback = std::function< void(const FlutterSemanticsNode *)>
 
using SemanticsActionCallback = std::function< void(const FlutterSemanticsCustomAction *)>
 
using LogMessageCallback = std::function< void(const char *tag, const char *message)>
 
using UniqueAOTData = std::unique_ptr< _FlutterEngineAOTData, AOTDataDeleter >
 
using EmbedderTest = testing::EmbedderTest
 
typedef std::function< bool()> MockKeyEventChannelHandler
 
typedef std::function< bool(const FlutterKeyEvent *event)> MockKeyEventEmbedderHandler
 
using CanvasTest = CanvasTestBase<::testing::Test >
 
using UniqueLoadedELF = std::unique_ptr< Dart_LoadedElf, LoadedELFDeleter >
 
using MockCanvasTest = CanvasTest
 
using NativeEntry = std::function< void(Dart_NativeArguments)>
 
using DartState = FixtureTest
 

Enumerations

enum  EmbedderTestContextType {
  EmbedderTestContextType::kSoftwareContext,
  EmbedderTestContextType::kOpenGLContext,
  EmbedderTestContextType::kMetalContext
}
 
enum  WmFieldExtended {
  kNotExtended = 0,
  kExtended = 1
}
 
enum  WmFieldContext {
  kNoContext = 0,
  kAltHeld = 1
}
 
enum  WmFieldPrevState {
  kWasUp = 0,
  kWasDown = 1
}
 
enum  WmFieldTransitionState {
  kBeingReleased = 0,
  kBeingPressed = 1
}
 
enum  DebuggerStatus {
  DebuggerStatus::kDontKnow,
  DebuggerStatus::kAttached
}
 
enum  MemsetPatternOp {
  MemsetPatternOp::kMemsetPatternOpSetBuffer,
  MemsetPatternOp::kMemsetPatternOpCheckBuffer
}
 

Functions

 TEST (DisplayListCanvas, DrawPaint)
 
 TEST (DisplayListCanvas, DrawColor)
 
BoundsTolerance lineTolerance (const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix, bool is_horizontal, bool is_vertical, bool ignores_butt_cap)
 
BoundsTolerance hLineTolerance (const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix)
 
BoundsTolerance vLineTolerance (const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix)
 
BoundsTolerance dLineTolerance (const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix)
 
BoundsTolerance pointsTolerance (const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix)
 
 TEST (DisplayListCanvas, DrawDiagonalLines)
 
 TEST (DisplayListCanvas, DrawHorizontalLine)
 
 TEST (DisplayListCanvas, DrawVerticalLine)
 
 TEST (DisplayListCanvas, DrawRect)
 
 TEST (DisplayListCanvas, DrawOval)
 
 TEST (DisplayListCanvas, DrawCircle)
 
 TEST (DisplayListCanvas, DrawRRect)
 
 TEST (DisplayListCanvas, DrawDRRect)
 
 TEST (DisplayListCanvas, DrawPath)
 
 TEST (DisplayListCanvas, DrawArc)
 
 TEST (DisplayListCanvas, DrawArcCenter)
 
 TEST (DisplayListCanvas, DrawPointsAsPoints)
 
 TEST (DisplayListCanvas, DrawPointsAsLines)
 
 TEST (DisplayListCanvas, DrawPointsAsPolygon)
 
 TEST (DisplayListCanvas, DrawVerticesWithColors)
 
 TEST (DisplayListCanvas, DrawVerticesWithImage)
 
 TEST (DisplayListCanvas, DrawImageNearest)
 
 TEST (DisplayListCanvas, DrawImageNearestNoPaint)
 
 TEST (DisplayListCanvas, DrawImageLinear)
 
 TEST (DisplayListCanvas, DrawImageRectNearest)
 
 TEST (DisplayListCanvas, DrawImageRectNearestNoPaint)
 
 TEST (DisplayListCanvas, DrawImageRectLinear)
 
 TEST (DisplayListCanvas, DrawImageNineNearest)
 
 TEST (DisplayListCanvas, DrawImageNineNearestNoPaint)
 
 TEST (DisplayListCanvas, DrawImageNineLinear)
 
 TEST (DisplayListCanvas, DrawImageLatticeNearest)
 
 TEST (DisplayListCanvas, DrawImageLatticeNearestNoPaint)
 
 TEST (DisplayListCanvas, DrawImageLatticeLinear)
 
 TEST (DisplayListCanvas, DrawAtlasNearest)
 
 TEST (DisplayListCanvas, DrawAtlasNearestNoPaint)
 
 TEST (DisplayListCanvas, DrawAtlasLinear)
 
sk_sp< SkPicture > makeTestPicture ()
 
 TEST (DisplayListCanvas, DrawPicture)
 
 TEST (DisplayListCanvas, DrawPictureWithMatrix)
 
 TEST (DisplayListCanvas, DrawPictureWithPaint)
 
 TEST (DisplayListCanvas, DrawDisplayList)
 
 TEST (DisplayListCanvas, DrawTextBlob)
 
const BoundsTolerance shadowTolerance (const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix)
 
 TEST (DisplayListCanvas, DrawShadow)
 
 TEST (DisplayListCanvas, DrawShadowTransparentOccluder)
 
 TEST (DisplayListCanvas, DrawShadowDpr)
 
static sk_sp< SkImage > MakeTestImage (int w, int h, int checker_size)
 
static sk_sp< SkPicture > MakeTestPicture (int w, int h, SkColor color)
 
static sk_sp< DisplayListMakeTestDisplayList (int w, int h, SkColor color)
 
static sk_sp< SkTextBlob > MakeTextBlob (std::string string)
 
 TEST (DisplayList, SingleOpSizes)
 
 TEST (DisplayList, SingleOpDisplayListsNotEqualEmpty)
 
 TEST (DisplayList, SingleOpDisplayListsRecapturedAreEqual)
 
 TEST (DisplayList, SingleOpDisplayListsRecapturedViaSkCanvasAreEqual)
 
 TEST (DisplayList, SingleOpDisplayListsCompareToEachOther)
 
static sk_sp< DisplayListBuild (size_t g_index, size_t v_index)
 
 TEST (DisplayList, DisplayListsWithVaryingOpComparisons)
 
 TEST (DisplayList, DisplayListSaveLayerBoundsWithAlphaFilter)
 
 TEST (EmbeddedViewParams, GetBoundingRectAfterMutationsWithNoMutations)
 
 TEST (EmbeddedViewParams, GetBoundingRectAfterMutationsWithScale)
 
 TEST (EmbeddedViewParams, GetBoundingRectAfterMutationsWithTranslate)
 
 TEST (EmbeddedViewParams, GetBoundingRectAfterMutationsWithRotation90)
 
 TEST (EmbeddedViewParams, GetBoundingRectAfterMutationsWithRotation45)
 
 TEST (EmbeddedViewParams, GetBoundingRectAfterMutationsWithTranslateScaleAndRotation)
 
 TEST (FrameTimingsRecorderTest, RecordVsync)
 
 TEST (FrameTimingsRecorderTest, RecordBuildTimes)
 
 TEST (FrameTimingsRecorderTest, RecordRasterTimes)
 
 TEST (FrameTimingsRecorderTest, RecordRasterTimesWithCache)
 
 TEST (FrameTimingsRecorderTest, ThrowAfterUnexpectedCacheSweep)
 
 TEST (FrameTimingsRecorderTest, ThrowWhenRecordBuildBeforeVsync)
 
 TEST (FrameTimingsRecorderTest, ThrowWhenRecordRasterBeforeBuildEnd)
 
 TEST (FrameTimingsRecorderTest, RecordersHaveUniqueFrameNumbers)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameFrameNumber)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameVsyncStartAndTarget)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameBuildStart)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameBuildEnd)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameRasterStart)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameRasterEnd)
 
 TEST (FrameTimingsRecorderTest, ClonedHasSameRasterEndWithCache)
 
 TEST (FrameTimingsRecorderTest, FrameNumberTraceArgIsValid)
 
 TEST (GLContextSwitchTest, SwitchKeepsContextCurrentWhileInScope)
 
 TEST_F (BackdropFilterLayerTest, PaintingEmptyLayerDies)
 
 TEST_F (BackdropFilterLayerTest, PaintBeforePrerollDies)
 
 TEST_F (BackdropFilterLayerTest, EmptyFilter)
 
 TEST_F (BackdropFilterLayerTest, SimpleFilter)
 
 TEST_F (BackdropFilterLayerTest, NonSrcOverBlend)
 
 TEST_F (BackdropFilterLayerTest, MultipleChildren)
 
 TEST_F (BackdropFilterLayerTest, Nested)
 
 TEST_F (BackdropFilterLayerTest, Readback)
 
 TEST_F (CheckerBoardLayerTest, ClipRectSaveLayerNotCheckBoard)
 
 TEST_F (CheckerBoardLayerTest, ClipRectSaveLayerCheckBoard)
 
 TEST_F (CheckerBoardLayerTest, ClipPathSaveLayerNotCheckBoard)
 
 TEST_F (CheckerBoardLayerTest, ClipPathSaveLayerCheckBoard)
 
 TEST_F (CheckerBoardLayerTest, ClipRRectSaveLayerNotCheckBoard)
 
 TEST_F (CheckerBoardLayerTest, ClipRRectSaveLayerCheckBoard)
 
 TEST_F (CheckerBoardLayerTest, PhysicalSaveLayerNotCheckBoard)
 
 TEST_F (CheckerBoardLayerTest, PhysicalSaveLayerCheckBoard)
 
 TEST_F (ClipPathLayerTest, ClipNoneBehaviorDies)
 
 TEST_F (ClipPathLayerTest, PaintingCulledLayerDies)
 
 TEST_F (ClipPathLayerTest, ChildOutsideBounds)
 
 TEST_F (ClipPathLayerTest, FullyContainedChild)
 
 TEST_F (ClipPathLayerTest, PartiallyContainedChild)
 
static bool ReadbackResult (PrerollContext *context, Clip clip_behavior, std::shared_ptr< Layer > child, bool before)
 
static bool ReadbackResult (PrerollContext *context, Clip clip_behavior, std::shared_ptr< Layer > child, bool before)
 
static bool ReadbackResult (PrerollContext *context, Clip clip_behavior, std::shared_ptr< Layer > child, bool before)
 
 TEST_F (ContainerLayerTest, LayerWithParentHasPlatformView)
 
 TEST_F (ContainerLayerTest, Simple)
 
 TEST_F (ContainerLayerTest, Multiple)
 
 TEST_F (ContainerLayerTest, MultipleWithEmpty)
 
 TEST_F (ContainerLayerTest, NeedsSystemComposite)
 
 TEST_F (ContainerLayerTest, MergedOneChild)
 
 TEST_F (ContainerLayerTest, MergedMultipleChildren)
 
 TEST_F (DisplayListLayerTest, PaintBeforePrerollInvalidDisplayListDies)
 
 TEST_F (DisplayListLayerTest, PaintBeforePrerollDies)
 
 TEST_F (DisplayListLayerTest, PaintingEmptyLayerDies)
 
 TEST_F (DisplayListLayerTest, InvalidDisplayListDies)
 
 TEST_F (DisplayListLayerTest, SimpleDisplayList)
 
 TEST_F (ImageFilterLayerTest, SimpleFilterBounds)
 
 TEST_F (ImageFilterLayerTest, ChildIsCached)
 
 TEST_F (ImageFilterLayerTest, ChildrenNotCached)
 
 TEST_F (LayerTreeTest, PaintingEmptyLayerDies)
 
 TEST_F (LayerTreeTest, PaintBeforePrerollDies)
 
 TEST_F (LayerTreeTest, Simple)
 
 TEST_F (LayerTreeTest, Multiple)
 
 TEST_F (LayerTreeTest, MultipleWithEmpty)
 
 TEST_F (LayerTreeTest, NeedsSystemComposite)
 
 TEST_F (OpacityLayerTest, LeafLayer)
 
 TEST_F (OpacityLayerTest, TranslateChildren)
 
 TEST_F (OpacityLayerTest, FullyOpaque)
 
 TEST_F (OpacityLayerTest, FullyTransparent)
 
 TEST_F (OpacityLayerTest, HalfTransparent)
 
 TEST_F (OpacityLayerTest, CullRectIsTransformed)
 
 TEST_F (PerformanceOverlayLayerTest, InvalidOptions)
 
 TEST_F (PerformanceOverlayLayerTest, SimpleRasterizerStatistics)
 
 TEST (PerformanceOverlayLayerDefault, Gold)
 
 TEST (PerformanceOverlayLayer90fps, Gold)
 
 TEST (PerformanceOverlayLayer120fps, Gold)
 
 TEST_F (PhysicalShapeLayerTest, NonEmptyLayer)
 
 TEST_F (PhysicalShapeLayerTest, ChildrenLargerThanPath)
 
 TEST_F (PhysicalShapeLayerTest, ElevationSimple)
 
 TEST_F (PhysicalShapeLayerTest, ElevationComplex)
 
 TEST_F (PhysicalShapeLayerTest, ShadowNotDependsCtm)
 
static int RasterizedDifferenceInPixels (const std::function< void(SkCanvas *)> &actual_draw_function, const std::function< void(SkCanvas *)> &expected_draw_function, const SkSize &canvas_size)
 
 TEST_F (PhysicalShapeLayerTest, ShadowNotDependsPathSize)
 
static bool ReadbackResult (PrerollContext *context, Clip clip_behavior, std::shared_ptr< Layer > child, bool before)
 
 TEST_F (PictureLayerTest, PaintBeforePrerollInvalidPictureDies)
 
 TEST_F (PictureLayerTest, InvalidPictureDies)
 
 TEST_F (PictureLayerTest, SimplePicture)
 
 TEST_F (PlatformViewLayerTest, NullViewEmbedderDoesntPrerollCompositeOrPaint)
 
 TEST_F (PlatformViewLayerTest, ClippedPlatformViewPrerollsAndPaintsNothing)
 
 TEST_F (TextureLayerTest, InvalidTexture)
 
 TEST_F (TextureLayerTest, PaintingWithLinearSampling)
 
 TEST_F (TransformLayerTest, Identity)
 
 TEST_F (TransformLayerTest, NestedSeparated)
 
 TEST (MatrixDecomposition, Rotation)
 
 TEST (MatrixDecomposition, Scale)
 
 TEST (MatrixDecomposition, Translate)
 
 TEST (MatrixDecomposition, Combination)
 
 TEST (MatrixDecomposition, ScaleFloatError)
 
 TEST (MutatorsStack, Initialization)
 
 TEST (MutatorsStack, CopyConstructor)
 
 TEST (MutatorsStack, CopyAndUpdateTheCopy)
 
 TEST (MutatorsStack, PushClipRect)
 
 TEST (MutatorsStack, PushClipRRect)
 
 TEST (MutatorsStack, PushClipPath)
 
 TEST (MutatorsStack, PushTransform)
 
 TEST (MutatorsStack, PushOpacity)
 
 TEST (MutatorsStack, Pop)
 
 TEST (MutatorsStack, Traversal)
 
 TEST (MutatorsStack, Equality)
 
 TEST (Mutator, Initialization)
 
 TEST (Mutator, CopyConstructor)
 
 TEST (Mutator, Equality)
 
 TEST (Mutator, UnEquality)
 
 TEST (RasterCache, SimpleInitialization)
 
 TEST (RasterCache, ThresholdIsRespected)
 
 TEST (RasterCache, AccessThresholdOfZeroDisablesCaching)
 
 TEST (RasterCache, PictureCacheLimitPerFrameIsRespectedWhenZero)
 
 TEST (RasterCache, SweepsRemoveUnusedFrames)
 
 TEST (RasterCache, DeviceRectRoundOut)
 
 TEST (RTree, searchNonOverlappingDrawnRectsNoIntersection)
 
 TEST (RTree, searchNonOverlappingDrawnRectsSingleRectIntersection)
 
 TEST (RTree, searchNonOverlappingDrawnRectsIgnoresNonDrawingRecords)
 
 TEST (RTree, searchNonOverlappingDrawnRectsMultipleRectIntersection)
 
 TEST (RTree, searchNonOverlappingDrawnRectsJoinRectsWhenIntersectedCase1)
 
 TEST (RTree, searchNonOverlappingDrawnRectsJoinRectsWhenIntersectedCase2)
 
 TEST (RTree, searchNonOverlappingDrawnRectsJoinRectsWhenIntersectedCase3)
 
 TEST_F (SkiaGpuObjectTest, QueueSimple)
 
 TEST_F (SkiaGpuObjectTest, ObjectDestructor)
 
 TEST_F (SkiaGpuObjectTest, ObjectReset)
 
 TEST_F (SkiaGpuObjectTest, ObjectResetTwice)
 
 TEST_F (AutoSaveLayerTests, SaveLayerOnInternalNodesCanvasByDefault)
 
 TEST_F (AutoSaveLayerTests, SaveLayerOnlyOnLeafNodesCanvas)
 
 TEST_F (MockLayerTest, SimpleParams)
 
 TEST_F (MockLayerTest, FakePlatformView)
 
 TEST_F (MockLayerTest, SaveLayerOnLeafNodesCanvas)
 
PrerollContextHolder GetSamplePrerollContextHolder ()
 
bool operator== (const MockTexture::PaintCall &a, const MockTexture::PaintCall &b)
 
std::ostream & operator<< (std::ostream &os, const MockTexture::PaintCall &data)
 
 TEST (MockTextureTest, Callbacks)
 
 TEST (MockTextureTest, PaintCalls)
 
 TEST (MockTextureTest, PaintCallsWithLinearSampling)
 
 TEST (TextureRegistryTest, UnregisterTextureCallbackTriggered)
 
 TEST (TextureRegistryTest, GrContextCallbackTriggered)
 
 TEST (TextureRegistryTest, RegisterTextureTwice)
 
 TEST (TextureRegistryTest, ReuseSameTextureSlot)
 
 TEST_F (ShellTest, SceneBuilderBuildAndSceneDisposeReleasesLayerStack)
 
 TEST_F (ShellTest, EngineLayerDisposeReleasesReference)
 
 TEST_F (HooksTest, HooksUnitTests)
 
static sk_sp< SkData > OpenFixtureAsSkData (const char *name)
 
 TEST_F (ImageDecoderFixtureTest, CanCreateImageDecoder)
 
 TEST_F (ImageDecoderFixtureTest, InvalidImageResultsError)
 
 TEST_F (ImageDecoderFixtureTest, ValidImageResultsInSuccess)
 
 TEST_F (ImageDecoderFixtureTest, ExifDataIsRespectedOnDecode)
 
 TEST_F (ImageDecoderFixtureTest, CanDecodeWithoutAGPUContext)
 
 TEST_F (ImageDecoderFixtureTest, CanDecodeWithResizes)
 
 TEST_F (ImageDecoderFixtureTest, DISABLED_CanResizeWithoutDecode)
 
 TEST (ImageDecoderTest, VerifyCodecRepeatCountsForGifAndWebPAreConsistentWithLoopCounts)
 
 TEST (ImageDecoderTest, VerifySimpleDecoding)
 
 TEST (ImageDecoderTest, VerifySubpixelDecodingPreservesExifOrientation)
 
 TEST_F (ImageDecoderFixtureTest, MultiFrameCodecCanBeCollectedBeforeIOTasksFinish)
 
 TEST_F (ImageDecoderFixtureTest, MultiFrameCodecDidAccessGpuDisabledSyncSwitch)
 
 TEST_F (ImageDisposeTest, ImageReleasedAfterFrameAndDisposePictureAndLayer)
 
 TEST_F (ShellTest, EncodeImageGivesExternalTypedData)
 
 TEST_F (ShellTest, EncodeImageAccessesSyncSwitch)
 
static sk_sp< SkData > LoadValidImageFixture ()
 
 TEST_F (ShellTest, CreateCompatibleReturnsBuiltinImageGeneratorForValidImage)
 
 TEST_F (ShellTest, CreateCompatibleReturnsNullptrForInvalidImage)
 
 TEST_F (ShellTest, PositivePriorityTakesPrecedentOverDefaultGenerators)
 
 TEST_F (ShellTest, DefaultGeneratorsTakePrecedentOverNegativePriority)
 
 TEST_F (ShellTest, DefaultGeneratorsTakePrecedentOverZeroPriority)
 
 TEST_F (ShellTest, ImageGeneratorsWithSamePriorityCascadeChronologically)
 
 TEST_F (ShellTest, PathVolatilityOldPathsBecomeNonVolatile)
 
 TEST_F (ShellTest, PathVolatilityGCRemovesPathFromTracker)
 
 TEST_F (ShellTest, DeterministicRenderingDisablesPathVolatility)
 
 TEST_F (ShellTest, SingleFrameCodecAccuratelyReportsSize)
 
 TEST_F (ShellTest, VerticesAccuratelyReportsSize)
 
 TEST_F (SemanticsUpdateBuilderTest, CanHandleAttributedStrings)
 
 TEST_F (ShellTest, PlatformConfigurationInitialization)
 
 TEST_F (ShellTest, PlatformConfigurationWindowMetricsUpdate)
 
void CreateSimulatedPointerData (PointerData &data, PointerData::Change change, int64_t device, double dx, double dy, int64_t buttons)
 
void CreateSimulatedMousePointerData (PointerData &data, PointerData::Change change, PointerData::SignalKind signal_kind, int64_t device, double dx, double dy, double scroll_delta_x, double scroll_delta_y, int64_t buttons)
 
void UnpackPointerPacket (std::vector< PointerData > &output, std::unique_ptr< PointerDataPacket > packet)
 
 TEST (PointerDataPacketConverterTest, CanConvetPointerDataPacket)
 
 TEST (PointerDataPacketConverterTest, CanSynthesizeDownAndUp)
 
 TEST (PointerDataPacketConverterTest, CanUpdatePointerIdentifier)
 
 TEST (PointerDataPacketConverterTest, AlwaysForwardMoveEvent)
 
 TEST (PointerDataPacketConverterTest, CanWorkWithDifferentDevices)
 
 TEST (PointerDataPacketConverterTest, CanSynthesizeAdd)
 
 TEST (PointerDataPacketConverterTest, CanHandleThreeFingerGesture)
 
 TEST (PointerDataPacketConverterTest, CanConvetScroll)
 
 TEST_F (DartIsolateTest, RootIsolateCreationAndShutdown)
 
 TEST_F (DartIsolateTest, SpawnIsolate)
 
 TEST_F (DartIsolateTest, IsolateShutdownCallbackIsInIsolateScope)
 
 TEST_F (DartIsolateTest, IsolateCanLoadAndRunDartCode)
 
 TEST_F (DartIsolateTest, IsolateCannotLoadAndRunUnknownDartEntrypoint)
 
 TEST_F (DartIsolateTest, CanRunDartCodeCodeSynchronously)
 
 TEST_F (DartIsolateTest, CanRegisterNativeCallback)
 
 TEST_F (DartSecondaryIsolateTest, CanLaunchSecondaryIsolates)
 
 TEST_F (DartIsolateTest, CanRecieveArguments)
 
 TEST_F (DartIsolateTest, CanCreateServiceIsolate)
 
 TEST_F (DartIsolateTest, RootIsolateCreateCallbackIsMadeOnceAndBeforeIsolateRunning)
 
 TEST_F (DartIsolateTest, IsolateCreateCallbacksTakeInstanceSettingsInsteadOfVMSettings)
 
 TEST_F (DartIsolateTest, InvalidLoadingUnitFails)
 
 TEST_F (DartIsolateTest, DISABLED_ValidLoadingUnitSucceeds)
 
 TEST_F (DartIsolateTest, DartPluginRegistrantIsCalled)
 
 TEST_F (DartLifecycleTest, CanStartAndShutdownVM)
 
 TEST_F (DartLifecycleTest, CanStartAndShutdownVMOverAndOver)
 
static std::shared_ptr< DartIsolateCreateAndRunRootIsolate (const Settings &settings, const DartVMData &vm, fml::RefPtr< fml::TaskRunner > task_runner, std::string entrypoint)
 
 TEST_F (DartLifecycleTest, DISABLED_ShuttingDownTheVMShutsDownAllIsolates)
 
 TEST_F (DartVMTest, SimpleInitialization)
 
 TEST_F (DartVMTest, SimpleIsolateNameServer)
 
 TEST_F (DartVMTest, OldGenHeapSize)
 
 TEST_F (DartIsolateTest, DartPluginRegistrantIsNotPresent)
 
 TEST_F (TypeConversionsTest, TestFixture)
 
 TEST_F (TypeConversionsTest, CanConvertEmptyList)
 
 TEST_F (TypeConversionsTest, CanConvertListOfStrings)
 
 TEST_F (TypeConversionsTest, CanConvertListOfDoubles)
 
 TEST_F (TypeConversionsTest, CanConvertListOfInts)
 
 TEST_F (TypeConversionsTest, CanConvertListOfFloatsToListOfDartDoubles)
 
 TEST_F (ShellTest, VSyncTargetTime)
 
 TEST_F (ShellTest, AnimatorStartsPaused)
 
 TEST_F (ShellTest, AnimatorDoesNotNotifyIdleBeforeRender)
 
 TEST (CanvasSpyTest, DrawingIsTracked)
 
 TEST (CanvasSpyTest, SpiedCanvasIsDrawing)
 
static void TestSimulatedInputEvents (ShellTest *fixture, int num_events, UnitlessTime base_latency, Generator delivery_time, UnitlessTime frame_time, std::vector< UnitlessTime > &events_consumed_at_frame, bool restart_engine=false)
 
void CreateSimulatedPointerData (PointerData &data, PointerData::Change change, double dx, double dy)
 
 TEST_F (ShellTest, MissAtMostOneFrameForIrregularInputEvents)
 
 TEST_F (ShellTest, DelayAtMostOneEventForFasterThanVSyncInputEvents)
 
 TEST_F (ShellTest, HandlesActualIphoneXsInputEvents)
 
 TEST_F (ShellTest, CanCorrectlyPipePointerPacket)
 
 TEST_F (ShellTest, CanCorrectlySynthesizePointerPacket)
 
static void WaitForIO (Shell *shell)
 
static void WaitForRaster (Shell *shell)
 
 TEST_F (PersistentCacheTest, CacheSkSLWorks)
 
 TEST_F (PersistentCacheTest, CanPrecompileMetalShaders)
 
static void CheckTextSkData (sk_sp< SkData > data, const std::string &expected)
 
static void ResetAssetManager ()
 
static void CheckTwoSkSLsAreLoaded ()
 
 TEST_F (PersistentCacheTest, CanLoadSkSLsFromAsset)
 
 TEST_F (PersistentCacheTest, CanRemoveOldPersistentCache)
 
 TEST_F (PersistentCacheTest, CanPurgePersistentCache)
 
 TEST_F (PersistentCacheTest, PurgeAllowsFutureSkSLCache)
 
 TEST (PipelineTest, ConsumeOneVal)
 
 TEST (PipelineTest, ContinuationCanOnlyBeUsedOnce)
 
 TEST (PipelineTest, PushingMoreThanDepthCompletesFirstSubmission)
 
 TEST (PipelineTest, PushingMultiProcessesInOrder)
 
 TEST (PipelineTest, ProduceIfEmptyDoesNotConsumeWhenQueueIsNotEmpty)
 
 TEST (PipelineTest, ProduceIfEmptySuccessfulIfQueueIsEmpty)
 
static bool ValidateShell (Shell *shell)
 
static void RunCoroutineWithRetry (int retries, fml::AutoResetWaitableEvent *tick, fml::AutoResetWaitableEvent *tock, std::function< bool()> f)
 
 TEST_F (FuchsiaShellTest, LocaltimesVaryOnTimezoneChanges)
 
static fml::scoped_nsprotocol< id< MTLTexture > > CreateOffscreenTexture (id< MTLDevice > device)
 
static bool ValidateShell (Shell *shell)
 
static bool RasterizerHasLayerTree (Shell *shell)
 
static void ValidateDestroyPlatformView (Shell *shell)
 
static std::string CreateFlagsString (std::vector< const char *> &flags)
 
static void TestDartVmFlags (std::vector< const char *> &flags)
 
static void PostSync (const fml::RefPtr< fml::TaskRunner > &task_runner, const fml::closure &task)
 
 TEST_F (ShellTest, InitializeWithInvalidThreads)
 
 TEST_F (ShellTest, InitializeWithDifferentThreads)
 
 TEST_F (ShellTest, InitializeWithSingleThread)
 
 TEST_F (ShellTest, InitializeWithSingleThreadWhichIsTheCallingThread)
 
 TEST_F (ShellTest, InitializeWithMultipleThreadButCallingThreadAsPlatformThread)
 
 TEST_F (ShellTest, InitializeWithDisabledGpu)
 
 TEST_F (ShellTest, InitializeWithGPUAndPlatformThreadsTheSame)
 
 TEST_F (ShellTest, FixturesAreFunctional)
 
 TEST_F (ShellTest, SecondaryIsolateBindingsAreSetupViaShellSettings)
 
 TEST_F (ShellTest, LastEntrypoint)
 
 TEST_F (ShellTest, DisallowedDartVMFlag)
 
 TEST_F (ShellTest, AllowedDartVMFlag)
 
 TEST_F (ShellTest, NoNeedToReportTimingsByDefault)
 
 TEST_F (ShellTest, NeedsReportTimingsIsSetWithCallback)
 
static void CheckFrameTimings (const std::vector< FrameTiming > &timings, fml::TimePoint start, fml::TimePoint finish)
 
 TEST_F (ShellTest, ReportTimingsIsCalled)
 
 TEST_F (ShellTest, FrameRasterizedCallbackIsCalled)
 
 TEST_F (ShellTest, ExternalEmbedderNoThreadMerger)
 
 TEST_F (ShellTest, ExternalEmbedderEndFrameIsCalledWhenPostPrerollResultIsResubmit)
 
 TEST_F (ShellTest, OnPlatformViewDestroyDisablesThreadMerger)
 
 TEST_F (ShellTest, OnPlatformViewDestroyAfterMergingThreads)
 
 TEST_F (ShellTest, OnPlatformViewDestroyWhenThreadsAreMerging)
 
 TEST_F (ShellTest, OnPlatformViewDestroyWithThreadMergerWhileThreadsAreUnmerged)
 
 TEST_F (ShellTest, OnPlatformViewDestroyWithoutRasterThreadMerger)
 
 TEST_F (ShellTest, OnPlatformViewDestroyWithStaticThreadMerging)
 
 TEST_F (ShellTest, DISABLED_SkipAndSubmitFrame)
 
 TEST_F (ShellTest, ResubmitFrame)
 
 TEST (SettingsTest, FrameTimingSetsAndGetsProperly)
 
 TEST_F (ShellTest, ReportTimingsIsCalledImmediatelyAfterTheFirstFrame)
 
 TEST_F (ShellTest, ReloadSystemFonts)
 
 TEST_F (ShellTest, WaitForFirstFrame)
 
 TEST_F (ShellTest, WaitForFirstFrameZeroSizeFrame)
 
 TEST_F (ShellTest, WaitForFirstFrameTimeout)
 
 TEST_F (ShellTest, WaitForFirstFrameMultiple)
 
 TEST_F (ShellTest, WaitForFirstFrameInlined)
 
static size_t GetRasterizerResourceCacheBytesSync (const Shell &shell)
 
 TEST_F (ShellTest, SetResourceCacheSize)
 
 TEST_F (ShellTest, SetResourceCacheSizeEarly)
 
 TEST_F (ShellTest, SetResourceCacheSizeNotifiesDart)
 
 TEST_F (ShellTest, CanCreateImagefromDecompressedBytes)
 
 TEST_F (ShellTest, TextureFrameMarkedAvailableAndUnregister)
 
 TEST_F (ShellTest, IsolateCanAccessPersistentIsolateData)
 
static void LogSkData (sk_sp< SkData > data, const char *title)
 
 TEST_F (ShellTest, Screenshot)
 
 TEST_F (ShellTest, CanConvertToAndFromMappings)
 
 TEST_F (ShellTest, LocaltimesMatch)
 
 TEST_F (ShellTest, CanDecompressImageFromAsset)
 
 TEST_F (ShellTest, CanRegisterImageDecoders)
 
 TEST_F (ShellTest, OnServiceProtocolGetSkSLsWorks)
 
 TEST_F (ShellTest, RasterizerScreenshot)
 
 TEST_F (ShellTest, RasterizerMakeRasterSnapshot)
 
static sk_sp< SkPicture > MakeSizedPicture (int width, int height)
 
 TEST_F (ShellTest, OnServiceProtocolEstimateRasterCacheMemoryWorks)
 
 TEST_F (ShellTest, DiscardLayerTreeOnResize)
 
 TEST_F (ShellTest, DiscardResubmittedLayerTreeOnResize)
 
 TEST_F (ShellTest, IgnoresInvalidMetrics)
 
 TEST_F (ShellTest, OnServiceProtocolSetAssetBundlePathWorks)
 
 TEST_F (ShellTest, EngineRootIsolateLaunchesDontTakeVMDataSettings)
 
 TEST_F (ShellTest, AssetManagerSingle)
 
 TEST_F (ShellTest, AssetManagerMulti)
 
 TEST_F (ShellTest, Spawn)
 
 TEST_F (ShellTest, UpdateAssetResolverByTypeReplaces)
 
 TEST_F (ShellTest, UpdateAssetResolverByTypeAppends)
 
 TEST_F (ShellTest, UpdateAssetResolverByTypeNull)
 
 TEST_F (ShellTest, UpdateAssetResolverByTypeDoesNotReplaceMismatchType)
 
 TEST_F (ShellTest, CanCreateShellsWithGLBackend)
 
 TEST_F (ShellTest, CanCreateShellsWithVulkanBackend)
 
 TEST_F (ShellTest, CanCreateShellsWithMetalBackend)
 
 TEST_F (ShellTest, UserTagSetOnStartup)
 
 TEST_F (ShellTest, PrefetchDefaultFontManager)
 
 TEST_F (ShellTest, OnPlatformViewCreatedWhenUIThreadIsBusy)
 
 TEST_F (ShellTest, UIWorkAfterOnPlatformViewDestroyed)
 
 TEST_F (ShellTest, UsesPlatformMessageHandler)
 
 TEST (SwitchesTest, SkiaTraceAllowlistFlag)
 
 TEST (AndroidShellHolder, Create)
 
 TEST (AndroidShellHolder, HandlePlatformMessage)
 
fml::RefPtr< fml::RasterThreadMergerGetThreadMergerFromPlatformThread (fml::Thread *rasterizer_thread=nullptr)
 
fml::RefPtr< fml::RasterThreadMergerGetThreadMergerFromRasterThread (fml::Thread *platform_thread)
 
 TEST (AndroidExternalViewEmbedder, GetCurrentCanvases)
 
 TEST (AndroidExternalViewEmbedder, GetCurrentCanvases__CompositeOrder)
 
 TEST (AndroidExternalViewEmbedder, CompositeEmbeddedView)
 
 TEST (AndroidExternalViewEmbedder, CancelFrame)
 
 TEST (AndroidExternalViewEmbedder, RasterizerRunsOnPlatformThread)
 
 TEST (AndroidExternalViewEmbedder, RasterizerRunsOnRasterizerThread)
 
 TEST (AndroidExternalViewEmbedder, PlatformViewRect)
 
 TEST (AndroidExternalViewEmbedder, PlatformViewRect__ChangedParams)
 
 TEST (AndroidExternalViewEmbedder, SubmitFrame)
 
 TEST (AndroidExternalViewEmbedder, SubmitFrame__overlayComposition)
 
 TEST (AndroidExternalViewEmbedder, SubmitFrame__platformViewWithoutAnyOverlay)
 
 TEST (AndroidExternalViewEmbedder, DoesNotCallJNIPlatformThreadOnlyMethods)
 
 TEST (AndroidExternalViewEmbedder, DestroyOverlayLayersOnSizeChange)
 
 TEST (AndroidExternalViewEmbedder, DoesNotDestroyOverlayLayersOnSizeChange)
 
 TEST (AndroidExternalViewEmbedder, SupportsDynamicThreadMerging)
 
 TEST (AndroidExternalViewEmbedder, DisableThreadMerger)
 
 TEST (AndroidExternalViewEmbedder, Teardown)
 
 TEST (SurfacePool, GetLayer__AllocateOneLayer)
 
 TEST (SurfacePool, GetUnusedLayers)
 
 TEST (SurfacePool, GetLayer__Recycle)
 
 TEST (SurfacePool, GetLayer__AllocateTwoLayers)
 
 TEST (SurfacePool, DestroyLayers)
 
 TEST (SurfacePool, DestroyLayers__frameSizeChanged)
 
 TEST (JNIMock, FlutterViewHandlePlatformMessage)
 
 TEST (PlatformViewShell, UpdateSemanticsDoesFlutterViewUpdateSemantics)
 
 TEST (PlatformViewShell, UpdateSemanticsDoesFlutterViewUpdateSemanticsWithStringAttribtes)
 
 TEST (PlatformViewShell, UpdateSemanticsDoesFlutterViewUpdateCustomAccessibilityActions)
 
 TEST (AccessibilityBridgeTest, basicTest)
 
 TEST (AccessibilityBridgeTest, canFireChildrenChangedCorrectly)
 
 TEST (AccessibilityBridgeTest, canUpdateDelegate)
 
 TEST (AccessibilityBridgeTest, canHandleSelectionChangeCorrectly)
 
 TEST (AccessibilityBridgeTest, doesNotAssignEditableRootToSelectableText)
 
 TEST (FlutterPlatformNodeDelegateTest, canPerfomActions)
 
 TEST (FlutterPlatformNodeDelegateTest, canGetAXNode)
 
 TEST (FlutterPlatformNodeDelegateTest, canCalculateBoundsCorrectly)
 
 TEST (FlutterPlatformNodeDelegateTest, canCalculateOffScreenBoundsCorrectly)
 
 TEST (FlutterPlatformNodeDelegateTest, canUseOwnerBridge)
 
 TEST (AccessibilityBridgeMacDelegateTest, sendsAccessibilityCreateNotificationToWindowOfFlutterView)
 
 TEST (AccessibilityBridgeMacDelegateTest, doesNotSendAccessibilityCreateNotificationWhenHeadless)
 
 TEST (AccessibilityBridgeMacDelegateTest, doesNotSendAccessibilityCreateNotificationWhenNoWindow)
 
 TEST (FlutterChannelKeyResponderUnittests, BasicKeyEvent)
 
 TEST (FlutterChannelKeyResponderUnittests, EmptyResponseIsTakenAsHandled)
 
 TEST (FlutterEmbedderExternalTextureUnittests, TestTextureResolution)
 
 TEST (FlutterEmbedderExternalTextureUnittests, TestPopulateExternalTexture)
 
 TEST (FlutterEmbedderExternalTextureUnittests, TestPopulateExternalTextureYUVA)
 
 TEST (FlutterEmbedderExternalTextureUnittests, TestPopulateExternalTextureYUVA2)
 
 TEST (FlutterEmbedderKeyResponderUnittests, BasicKeyEvent)
 
 TEST (FlutterEmbedderKeyResponderUnittests, NonAsciiCharacters)
 
 TEST (FlutterEmbedderKeyResponderUnittests, IgnoreDuplicateDownEvent)
 
 TEST (FlutterEmbedderKeyResponderUnittests, IgnoreDuplicateUpEvent)
 
 TEST (FlutterEmbedderKeyResponderUnittests, ToggleModifiersDuringKeyTap)
 
 TEST (FlutterEmbedderKeyResponderUnittests, SpecialModiferFlags)
 
 TEST (FlutterEmbedderKeyResponderUnittests, IdentifyLeftAndRightModifiers)
 
 TEST (FlutterEmbedderKeyResponderUnittests, SynthesizeMissedModifierEvents)
 
 TEST (FlutterEmbedderKeyResponderUnittests, SynthesizeMissedModifierEventsInNormalEvents)
 
 TEST (FlutterEmbedderKeyResponderUnittests, ConvertCapsLockEvents)
 
 TEST (FlutterEmbedderKeyResponderUnittests, SynchronizeCapsLockStateOnCapsLock)
 
 TEST (FlutterEmbedderKeyResponderUnittests, SynchronizeCapsLockStateOnNormalKey)
 
 TEST_F (FlutterEngineTest, CanLaunch)
 
 TEST_F (FlutterEngineTest, MessengerSend)
 
 TEST_F (FlutterEngineTest, CanToggleAccessibility)
 
 TEST_F (FlutterEngineTest, CanToggleAccessibilityWhenHeadless)
 
 TEST_F (FlutterEngineTest, ResetsAccessibilityBridgeWhenSetsNewViewController)
 
 TEST_F (FlutterEngineTest, NativeCallbacks)
 
 TEST (FlutterEngine, Compositor)
 
 TEST (FlutterEngine, DartEntrypointArguments)
 
 TEST_F (FlutterEngineTest, MessengerCleanupConnectionWorks)
 
 TEST (FlutterFrameBufferProviderTest, TestCreate)
 
 TEST (FlutterGLCompositorTest, TestPresent)
 
 TEST (FlutterKeyboardManagerUnittests, NextResponderShouldThrowOnKeyUp)
 
 TEST (FlutterKeyboardManagerUnittests, SinglePrimaryResponder)
 
 TEST (FlutterKeyboardManagerUnittests, DoublePrimaryResponder)
 
 TEST (FlutterKeyboardManagerUnittests, SingleFinalResponder)
 
 TEST (FlutterKeyboardManagerUnittests, EmptyNextResponder)
 
 TEST (FlutterMetalCompositorTest, TestPresent)
 
 TEST (FlutterMetalCompositorTest, TestCreate)
 
 TEST (FlutterMetalCompositorTest, TestCompositing)
 
 TEST (FlutterMetalRenderer, PresentDelegatesToFlutterView)
 
 TEST (FlutterMetalRenderer, TextureReturnedByFlutterView)
 
static FlutterMetalSurfaceManagerCreateSurfaceManager ()
 
 TEST (FlutterMetalSurfaceManager, EnsureSizeUpdatesSize)
 
 TEST (FlutterMetalSurfaceManager, EnsureSizeUpdatesSizeForBackBuffer)
 
 TEST (FlutterOpenGLRenderer, RegisterExternalTexture)
 
 TEST (FlutterOpenGLRenderer, UnregisterExternalTexture)
 
 TEST (FlutterOpenGLRenderer, MarkExternalTextureFrameAvailable)
 
 TEST (FlutterOpenGLRenderer, PresetDelegatesToFlutterView)
 
 TEST (FlutterOpenGLRenderer, FBOReturnedByFlutterView)
 
 TEST (FlutterPlatformNodeDelegateMac, Basics)
 
 TEST (FlutterPlatformNodeDelegateMac, SelectableTextHasCorrectSemantics)
 
 TEST (FlutterPlatformNodeDelegateMac, SelectableTextWithoutSelectionReturnZeroRange)
 
 TEST (FlutterPlatformNodeDelegateMac, CanPerformAction)
 
 TEST (FlutterPlatformNodeDelegateMac, TextFieldUsesFlutterTextField)
 
 TEST (FlutterTextInputPluginTest, TestEmptyCompositionRange)
 
 TEST (FlutterTextInputPluginTest, TestFirstRectForCharacterRange)
 
 TEST (FlutterTextInputPluginTest, CanWorkWithFlutterTextField)
 
 TEST (FlutterTextInputPluginTest, CanNotBecomeResponderIfNoViewController)
 
 TEST (FlutterTextInputSemanticsObjectTest, DoesInitialize)
 
 TEST (FlutterViewController, HasStringsWhenPasteboardEmpty)
 
 TEST (FlutterViewController, HasStringsWhenPasteboardFull)
 
 TEST (FlutterViewController, HasViewThatHidesOtherViewsInAccessibility)
 
 TEST (FlutterViewController, SetsFlutterViewFirstResponderWhenAccessibilityDisabled)
 
 TEST (FlutterViewController, CanSetMouseTrackingModeBeforeViewLoaded)
 
 TEST (FlutterViewControllerTest, TestKeyEventsAreSentToFramework)
 
 TEST (FlutterViewControllerTest, TestKeyEventsArePropagatedIfNotHandled)
 
 TEST (FlutterViewControllerTest, TestKeyEventsAreNotPropagatedIfHandled)
 
 TEST (FlutterViewControllerTest, TestFlagsChangedEventsArePropagatedIfNotHandled)
 
 TEST (FlutterViewControllerTest, TestPerformKeyEquivalentSynthesizesKeyUp)
 
id CreateMockViewController (NSString *pasteboardString)
 
 TEST_F (Embedder11yTest, DISABLED_A11yTreeIsConsistent)
 
static void InvokeAllCallbacks (const std::vector< fml::closure > &callbacks)
 
 TEST (EmbedderTestNoFixture, MustNotRunWithInvalidArgs)
 
 TEST_F (EmbedderTest, CanLaunchAndShutdownWithValidProjectArgs)
 
 TEST_F (EmbedderTest, DISABLED_CanLaunchAndShutdownMultipleTimes)
 
 TEST_F (EmbedderTest, CanInvokeCustomEntrypoint)
 
 TEST_F (EmbedderTest, CanInvokeCustomEntrypointMacro)
 
 TEST_F (EmbedderTest, CanTerminateCleanly)
 
 TEST_F (EmbedderTest, CanSpecifyCustomPlatformTaskRunner)
 
 TEST (EmbedderTestNoFixture, CanGetCurrentTimeInNanoseconds)
 
 TEST_F (EmbedderTest, CanReloadSystemFonts)
 
 TEST_F (EmbedderTest, IsolateServiceIdSent)
 
 TEST_F (EmbedderTest, CanCreateAndCollectCallbacks)
 
 TEST_F (EmbedderTest, PlatformMessagesCanReceiveResponse)
 
 TEST_F (EmbedderTest, PlatformMessagesCanBeSentWithoutResponseHandles)
 
 TEST_F (EmbedderTest, NullPlatformMessagesCanBeSent)
 
 TEST_F (EmbedderTest, InvalidPlatformMessages)
 
 TEST_F (EmbedderTest, CanSetCustomLogMessageCallback)
 
 TEST_F (EmbedderTest, CanSetCustomLogTag)
 Tests that setting a custom log tag works. More...
 
 TEST_F (EmbedderTest, VMShutsDownWhenNoEnginesInProcess)
 
 TEST_F (EmbedderTest, DartEntrypointArgs)
 
 TEST_F (EmbedderTest, VMAndIsolateSnapshotSizesAreRedundantInAOTMode)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderKnownSceneWithSoftwareCompositor)
 
 TEST_F (EmbedderTest, CanCreateInitializedEngine)
 
 TEST_F (EmbedderTest, CanRunInitializedEngine)
 
 TEST_F (EmbedderTest, CaDeinitializeAnEngine)
 
 TEST_F (EmbedderTest, CanUpdateLocales)
 
 TEST_F (EmbedderTest, LocalizationCallbacksCalled)
 
 TEST_F (EmbedderTest, CanQueryDartAOTMode)
 
 TEST_F (EmbedderTest, VerifyB143464703WithSoftwareBackend)
 
 TEST_F (EmbedderTest, CanSendLowMemoryNotification)
 
 TEST_F (EmbedderTest, CanPostTaskToAllNativeThreads)
 
 TEST_F (EmbedderTest, InvalidAOTDataSourcesMustReturnError)
 
 TEST_F (EmbedderTest, MustNotRunWithMultipleAOTSources)
 
 TEST_F (EmbedderTest, CanCreateAndCollectAValidElfSource)
 
 TEST_F (EmbedderTest, CanLaunchAndShutdownWithAValidElfSource)
 
 TEST_F (EmbedderTest, InvalidFlutterWindowMetricsEvent)
 
FlutterKeyEventType UnserializeKeyEventKind (uint64_t kind)
 
void ExpectKeyEventEq (const FlutterKeyEvent &subject, const FlutterKeyEvent &baseline)
 
 TEST_F (EmbedderTest, KeyDataIsCorrectlySerialized)
 
 TEST_F (EmbedderTest, KeyDataResponseIsCorrectlyInvoked)
 
 TEST_F (EmbedderTest, BackToBackKeyEventResponsesCorrectlyInvoked)
 
 TEST_F (EmbedderTest, CanCreateOpenGLRenderingEngine)
 
 TEST_F (EmbedderTest, MustPreventEngineLaunchWhenRequiredCompositorArgsAreAbsent)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderToOpenGLFramebuffer)
 
 TEST_F (EmbedderTest, RasterCacheDisabledWithPlatformViews)
 
 TEST_F (EmbedderTest, RasterCacheEnabled)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderToOpenGLTexture)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderToSoftwareBuffer)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderKnownScene)
 
 TEST_F (EmbedderTest, CustomCompositorMustWorkWithCustomTaskRunner)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderWithRootLayerOnly)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderWithPlatformLayerOnBottom)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderKnownSceneWithRootSurfaceTransformation)
 
 TEST_F (EmbedderTest, CanRenderSceneWithoutCustomCompositor)
 
 TEST_F (EmbedderTest, CanRenderSceneWithoutCustomCompositorWithTransformation)
 
 TEST_F (EmbedderTest, CanRenderGradientWithoutCompositor)
 
 TEST_F (EmbedderTest, CanRenderGradientWithoutCompositorWithXform)
 
 TEST_F (EmbedderTest, CanRenderGradientWithCompositor)
 
 TEST_F (EmbedderTest, CanRenderGradientWithCompositorWithXform)
 
 TEST_F (EmbedderTest, CanRenderGradientWithCompositorOnNonRootLayer)
 
 TEST_F (EmbedderTest, CanRenderGradientWithCompositorOnNonRootLayerWithXform)
 
 TEST_F (EmbedderTest, VerifyB141980393)
 
 TEST_F (EmbedderTest, CanCreateEmbedderWithCustomRenderTaskRunner)
 
 TEST_F (EmbedderTest, CanCreateEmbedderWithCustomRenderTaskRunnerTheSameAsPlatformTaskRunner)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderKnownScenePixelRatioOnSurface)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderKnownScenePixelRatioOnSurfaceWithRootSurfaceXformation)
 
 TEST_F (EmbedderTest, PushingMutlipleFramesSetsUpNewRecordingCanvasWithCustomCompositor)
 
 TEST_F (EmbedderTest, PushingMutlipleFramesSetsUpNewRecordingCanvasWithoutCustomCompositor)
 
 TEST_F (EmbedderTest, PlatformViewMutatorsAreValid)
 
 TEST_F (EmbedderTest, PlatformViewMutatorsAreValidWithPixelRatio)
 
 TEST_F (EmbedderTest, PlatformViewMutatorsAreValidWithPixelRatioAndRootSurfaceTransformation)
 
 TEST_F (EmbedderTest, EmptySceneIsAcceptable)
 
 TEST_F (EmbedderTest, SceneWithNoRootContainerIsAcceptable)
 
 TEST_F (EmbedderTest, ArcEndCapsAreDrawnCorrectly)
 
 TEST_F (EmbedderTest, ClipsAreCorrectlyCalculated)
 
 TEST_F (EmbedderTest, ComplexClipsAreCorrectlyCalculated)
 
 TEST_F (EmbedderTest, ObjectsCanBePostedViaPorts)
 
 TEST_F (EmbedderTest, CompositorCanPostZeroLayersForPresentation)
 
 TEST_F (EmbedderTest, CompositorCanPostOnlyPlatformViews)
 
 TEST_F (EmbedderTest, CompositorRenderTargetsAreRecycled)
 
 TEST_F (EmbedderTest, CompositorRenderTargetsAreInStableOrder)
 
 TEST_F (EmbedderTest, FrameInfoContainsValidWidthAndHeight)
 
 TEST_F (EmbedderTest, MustNotRunWithBothFBOCallbacksSet)
 
 TEST_F (EmbedderTest, MustNotRunWithBothPresentCallbacksSet)
 
 TEST_F (EmbedderTest, PresentInfoContainsValidFBOId)
 
 TEST_F (EmbedderTest, SetSingleDisplayConfigurationWithDisplayId)
 
 TEST_F (EmbedderTest, SetSingleDisplayConfigurationWithoutDisplayId)
 
 TEST_F (EmbedderTest, SetValidMultiDisplayConfiguration)
 
 TEST_F (EmbedderTest, MultipleDisplaysWithSingleDisplayTrueIsInvalid)
 
 TEST_F (EmbedderTest, MultipleDisplaysWithSameDisplayIdIsInvalid)
 
 TEST_F (EmbedderTest, CompositorRenderTargetsNotRecycledWhenAvoidsCacheSet)
 
 TEST_F (EmbedderTest, SnapshotRenderTargetScalesDownToDriverMax)
 
 TEST_F (EmbedderTest, ObjectsPostedViaPortsServicedOnSecondaryTaskHeap)
 
 TEST_F (EmbedderTest, CreateInvalidBackingstoreOpenGLTexture)
 
 TEST_F (EmbedderTest, CreateInvalidBackingstoreOpenGLFramebuffer)
 
 TEST_F (EmbedderTest, ExternalTextureGLRefreshedTooOften)
 
 TEST_F (EmbedderTest, CanRenderGradientWithMetal)
 
static sk_sp< SkSurface > GetSurfaceFromTexture (sk_sp< GrDirectContext > skia_context, SkISize texture_size, void *texture)
 
 TEST_F (EmbedderTest, ExternalTextureMetal)
 
 TEST_F (EmbedderTest, MetalCompositorMustBeAbleToRenderPlatformViews)
 
 TEST_F (EmbedderTest, CanRenderSceneWithoutCustomCompositorMetal)
 
 TEST_F (EmbedderTest, CompositorMustBeAbleToRenderKnownSceneMetal)
 
 TEST_F (EmbedderTest, CreateInvalidBackingstoreMetalTexture)
 
 TEST_F (EmbedderTest, ExternalTextureMetalRefreshedTooOften)
 
 TEST (EmbedderProcTable, AllPointersProvided)
 
 TEST (EmbedderProcTable, NoDuplicatePointers)
 
 TEST (EmbedderProcTable, CallProc)
 
sk_sp< SkSurface > CreateRenderSurface (const FlutterLayer &layer, GrDirectContext *context)
 
static sk_sp< SkData > NormalizeImage (sk_sp< SkImage > image)
 
bool RasterImagesAreSame (sk_sp< SkImage > a, sk_sp< SkImage > b)
 
bool WriteImageToDisk (const fml::UniqueFD &directory, const std::string &name, sk_sp< SkImage > image)
 
bool ImageMatchesFixture (const std::string &fixture_file_name, sk_sp< SkImage > scene_image)
 
bool ImageMatchesFixture (const std::string &fixture_file_name, std::future< sk_sp< SkImage >> &scene_image)
 
void FilterMutationsByType (const FlutterPlatformViewMutation **mutations, size_t count, FlutterPlatformViewMutationType type, std::function< void(const FlutterPlatformViewMutation &mutation)> handler)
 
void FilterMutationsByType (const FlutterPlatformView *view, FlutterPlatformViewMutationType type, std::function< void(const FlutterPlatformViewMutation &mutation)> handler)
 
SkMatrix GetTotalMutationTransformationMatrix (const FlutterPlatformViewMutation **mutations, size_t count)
 
SkMatrix GetTotalMutationTransformationMatrix (const FlutterPlatformView *view)
 
 TEST (DpiUtilsTest, NonZero)
 
 TEST (DpiUtilsTest, NullHwndUsesPrimaryMonitor)
 
 TEST (FlutterProjectBundle, BasicPropertiesAbsolutePaths)
 
 TEST (FlutterProjectBundle, BasicPropertiesRelativePaths)
 
 TEST (FlutterProjectBundle, SwitchesEmpty)
 
 TEST (FlutterProjectBundle, DartEntrypointArguments)
 
 TEST (FlutterProjectBundle, Switches)
 
 TEST (FlutterWindowWin32Test, CreateDestroy)
 
 TEST (FlutterWindowWin32Test, NonPrintableKeyDownPropagation)
 
 TEST (FlutterWindowWin32Test, CharKeyDownPropagation)
 
 TEST (FlutterWindowWin32Test, ModifierKeyDownPropagation)
 
 TEST (FlutterWindowWin32Test, OnCursorRectUpdatedRegularDPI)
 
 TEST (FlutterWindowWin32Test, OnCursorRectUpdatedHighDPI)
 
 TEST (FlutterWindowWin32Test, OnPointerStarSendsDeviceType)
 
 TEST (FlutterWindowsEngine, RunDoesExpectedInitialization)
 
 TEST (FlutterWindowsEngine, RunWithoutANGLEUsesSoftware)
 
 TEST (FlutterWindowsEngine, SendPlatformMessageWithoutResponse)
 
 TEST (FlutterWindowsEngine, SendPlatformMessageWithResponse)
 
 TEST (FlutterWindowsEngine, DispatchSemanticsAction)
 
 TEST (FlutterWindowsTextureRegistrarTest, CreateDestroy)
 
 TEST (FlutterWindowsTextureRegistrarTest, RegisterUnregisterTexture)
 
 TEST (FlutterWindowsTextureRegistrarTest, RegisterUnknownTextureType)
 
 TEST (FlutterWindowsTextureRegistrarTest, PopulatePixelBufferTexture)
 
 TEST (FlutterWindowsTextureRegistrarTest, PopulateInvalidTexture)
 
 TEST (FlutterWindowsViewTest, KeySequence)
 
 TEST (FlutterWindowsViewTest, RestartClearsKeyboardState)
 
 TEST (FlutterWindowsViewTest, EnableSemantics)
 
 TEST (KeyboardKeyChannelHandlerTest, KeyboardHookHandling)
 
 TEST (KeyboardKeyChannelHandlerTest, ExtendedKeysAreSentToRedispatch)
 
 TEST (KeyboardKeyChannelHandlerTest, DeadKeysDoNotCrash)
 
 TEST (KeyboardKeyEmbedderHandlerTest, ConvertChar32ToUtf8)
 
 TEST (KeyboardKeyEmbedderHandlerTest, BasicKeyPressingAndHolding)
 
 TEST (KeyboardKeyEmbedderHandlerTest, ToggleNumLockDuringNumpadPress)
 
 TEST (KeyboardKeyEmbedderHandlerTest, ImeEventsAreIgnored)
 
 TEST (KeyboardKeyEmbedderHandlerTest, ModifierKeysByExtendedBit)
 
 TEST (KeyboardKeyEmbedderHandlerTest, ModifierKeysByVirtualKey)
 
 TEST (KeyboardKeyEmbedderHandlerTest, RepeatedDownIsIgnored)
 
 TEST (KeyboardKeyEmbedderHandlerTest, AbruptRepeatIsConvertedToDown)
 
 TEST (KeyboardKeyEmbedderHandlerTest, AbruptUpIsIgnored)
 
 TEST (KeyboardKeyEmbedderHandlerTest, SynthesizeForDesyncPressingState)
 
 TEST (KeyboardKeyEmbedderHandlerTest, SynthesizeForDesyncToggledState)
 
 TEST (KeyboardKeyEmbedderHandlerTest, SynthesizeForDesyncToggledStateByItself)
 
 TEST (KeyboardKeyEmbedderHandlerTest, SynthesizeWithInitialTogglingState)
 
 TEST (KeyboardKeyHandlerTest, SingleDelegateWithAsyncResponds)
 
 TEST (KeyboardKeyHandlerTest, SingleDelegateWithSyncResponds)
 
 TEST (KeyboardKeyHandlerTest, WithTwoAsyncDelegates)
 
 TEST (KeyboardKeyHandlerTest, WithSlowFrameworkResponse)
 
 TEST (KeyboardKeyHandlerTest, NeverRedispatchShiftRightKeyDown)
 
 TEST (KeyboardKeyHandlerTest, AltGr)
 
 TEST (KeyboardTest, LowerCaseAHandled)
 
 TEST (KeyboardTest, LowerCaseAUnhandled)
 
 TEST (KeyboardTest, ShiftLeftKeyA)
 
 TEST (KeyboardTest, CtrlLeftKeyA)
 
 TEST (KeyboardTest, CtrlLeftDigit1)
 
 TEST (KeyboardTest, Digit1OnFrenchLayout)
 
 TEST (KeyboardTest, AltGrModifiedKey)
 
 TEST (KeyboardTest, DeadKeyThatCombines)
 
 TEST (KeyboardTest, DeadKeyThatDoesNotCombine)
 
 TEST (KeyboardTest, MultibyteCharacter)
 
 TEST (PlatformHandler, GettingTextCallsThrough)
 
 TEST (PlatformHandler, RejectsGettingUnknownTypes)
 
 TEST (PlatformHandler, GetHasStringsCallsThrough)
 
 TEST (PlatformHandler, RejectsGetHasStringsOnUnknownTypes)
 
 TEST (PlatformHandler, SettingTextCallsThrough)
 
 TEST (PlatformHandler, RejectsSettingUnknownTypes)
 
 TEST (SequentialIdGeneratorTest, RemoveMultipleNumbers)
 
 TEST (SequentialIdGeneratorTest, MaybeRemoveNumbers)
 
 TEST (StringConversion, Utf16FromUtf8Empty)
 
 TEST (StringConversion, Utf16FromUtf8Ascii)
 
 TEST (StringConversion, Utf16FromUtf8Unicode)
 
 TEST (StringConversion, Utf8FromUtf16Empty)
 
 TEST (StringConversion, Utf8FromUtf16Ascii)
 
 TEST (StringConversion, Utf8FromUtf16Unicode)
 
 TEST (SystemUtils, GetPreferredLanguageInfo)
 
 TEST (SystemUtils, GetPreferredLanguages)
 
 TEST (SystemUtils, ParseLanguageNameGeneric)
 
 TEST (SystemUtils, ParseLanguageNameWithRegion)
 
 TEST (SystemUtils, ParseLanguageNameWithScript)
 
 TEST (SystemUtils, ParseLanguageNameWithRegionAndScript)
 
 TEST (SystemUtils, ParseLanguageNameWithSuplementalLanguage)
 
 TEST (SystemUtils, ParseLanguageNameWithThreeCharacterLanguage)
 
 TEST (SystemUtils, GetUserTimeFormat)
 
 TEST (SystemUtils, Prefer24HourTimeHandlesEmptyFormat)
 
 TEST (SystemUtils, Prefer24HourTimeHandles12Hour)
 
 TEST (SystemUtils, Prefer24HourTimeHandles24Hour)
 
 TEST (SystemUtils, GetPreferredBrightness)
 
 TEST (TaskRunnerTest, MaybeExecuteTaskWithExactOrder)
 
 TEST (TaskRunnerTest, MaybeExecuteTaskOnlyExpired)
 
char * clone_string (const char *string)
 
::testing::AssertionResult _EventEquals (const char *expr_event, const char *expr_expected, const FlutterKeyEvent &event, const FlutterKeyEvent &expected)
 
LPARAM CreateKeyEventLparam (USHORT scancode, bool extended, bool was_down, USHORT repeat_count, bool context_code, bool transition_state)
 
void MockEmbedderApiForKeyboard (EngineModifier &modifier, MockKeyEventChannelHandler channel_handler, MockKeyEventEmbedderHandler embedder_handler)
 
 TEST (TestKeyboard, CloneString)
 
 TEST (TestKeyboard, CreateKeyEventLparam)
 
 TEST (TextInputPluginTest, TextMethodsWorksWithEmptyModel)
 
 TEST (TextInputPluginTest, ClearClientResetsComposing)
 
 TEST (ApplicationStore, GetApps)
 
 TEST (ApplicationStore, GetAppsByPackageFamily)
 
 TEST (WindowProcDelegateManagerWin32Test, CallsCorrectly)
 
 TEST (WindowProcDelegateManagerWin32Test, ReplacementRegister)
 
 TEST (WindowProcDelegateManagerWin32Test, RegisterMultiple)
 
 TEST (WindowProcDelegateManagerWin32Test, ConflictingDelegates)
 
 TEST (WindowProcDelegateManagerWin32Test, Unregister)
 
 TEST (MockWin32Window, CreateDestroy)
 
 TEST (MockWin32Window, GetDpiAfterCreate)
 
 TEST (MockWin32Window, VerticalScroll)
 
 TEST (MockWin32Window, HorizontalScroll)
 
 TEST (MockWin32Window, KeyDown)
 
 TEST (MockWin32Window, KeyUp)
 
 TEST (MockWin32Window, KeyDownPrintable)
 
 TEST (MockWin32Window, KeyDownWithCtrl)
 
 TEST (MockWin32Window, KeyDownWithCtrlToggled)
 
bool NumberNear (double a, double b)
 
std::ostream & operator<< (std::ostream &os, const SkClipOp &o)
 
std::ostream & operator<< (std::ostream &os, const SkMatrix &m)
 
std::ostream & operator<< (std::ostream &os, const SkM44 &m)
 
std::ostream & operator<< (std::ostream &os, const SkVector3 &v)
 
std::ostream & operator<< (std::ostream &os, const SkRect &r)
 
std::ostream & operator<< (std::ostream &os, const SkRRect &r)
 
std::ostream & operator<< (std::ostream &os, const SkPath &r)
 
std::ostream & operator<< (std::ostream &os, const SkPoint &r)
 
std::ostream & operator<< (std::ostream &os, const SkISize &size)
 
std::ostream & operator<< (std::ostream &os, const SkColor4f &r)
 
std::ostream & operator<< (std::ostream &os, const SkPaint &r)
 
std::ostream & operator<< (std::ostream &os, const SkSamplingOptions &s)
 
std::unique_ptr< AutoIsolateShutdownRunDartCodeInIsolateOnUITaskRunner (DartVMRef &vm_ref, const Settings &p_settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &kernel_file_path, fml::WeakPtr< IOManager > io_manager, std::shared_ptr< VolatilePathTracker > volatile_path_tracker)
 
std::unique_ptr< AutoIsolateShutdownRunDartCodeInIsolate (DartVMRef &vm_ref, const Settings &settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &kernel_file_path, fml::WeakPtr< IOManager > io_manager, std::shared_ptr< VolatilePathTracker > volatile_path_tracker)
 
void RunDartCodeInIsolate (DartVMRef &vm_ref, std::unique_ptr< AutoIsolateShutdown > &result, const Settings &settings, const TaskRunners &task_runners, std::string entrypoint, const std::vector< std::string > &args, const std::string &fixtures_path, fml::WeakPtr< IOManager > io_manager={}, std::shared_ptr< VolatilePathTracker > volatile_path_tracker=nullptr)
 
DebuggerStatus GetDebuggerStatus ()
 
ELFAOTSymbols LoadELFSymbolFromFixturesIfNeccessary (std::string elf_filename)
 Attempts to resolve AOT symbols from the portable ELF loader. This location is automatically resolved from the fixtures generator. This only returns valid symbols when the VM is configured for AOT. More...
 
ELFAOTSymbols LoadELFSplitSymbolFromFixturesIfNeccessary (std::string elf_split_filename)
 Attempts to resolve split loading unit AOT symbols from the portable ELF loader. If the dart code does not make use of deferred libraries, then there will be no split .so to load. This only returns valid symbols when the VM is configured for AOT. More...
 
bool PrepareSettingsForAOTWithSymbols (Settings &settings, const ELFAOTSymbols &symbols)
 Prepare the settings objects various AOT mappings resolvers with the symbols already loaded. This method does nothing in non-AOT runtime modes. More...
 
bool operator== (const MockCanvas::SaveData &a, const MockCanvas::SaveData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::SaveData &data)
 
bool operator== (const MockCanvas::SaveLayerData &a, const MockCanvas::SaveLayerData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::SaveLayerData &data)
 
bool operator== (const MockCanvas::RestoreData &a, const MockCanvas::RestoreData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::RestoreData &data)
 
bool operator== (const MockCanvas::ConcatMatrixData &a, const MockCanvas::ConcatMatrixData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::ConcatMatrixData &data)
 
bool operator== (const MockCanvas::SetMatrixData &a, const MockCanvas::SetMatrixData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::SetMatrixData &data)
 
bool operator== (const MockCanvas::DrawRectData &a, const MockCanvas::DrawRectData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawRectData &data)
 
bool operator== (const MockCanvas::DrawPathData &a, const MockCanvas::DrawPathData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawPathData &data)
 
bool operator== (const MockCanvas::DrawTextData &a, const MockCanvas::DrawTextData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawTextData &data)
 
bool operator== (const MockCanvas::DrawPictureData &a, const MockCanvas::DrawPictureData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawPictureData &data)
 
bool operator== (const MockCanvas::DrawShadowData &a, const MockCanvas::DrawShadowData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawShadowData &data)
 
bool operator== (const MockCanvas::ClipRectData &a, const MockCanvas::ClipRectData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::ClipRectData &data)
 
bool operator== (const MockCanvas::ClipRRectData &a, const MockCanvas::ClipRRectData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::ClipRRectData &data)
 
bool operator== (const MockCanvas::ClipPathData &a, const MockCanvas::ClipPathData &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::ClipPathData &data)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawCallData &data)
 
bool operator== (const MockCanvas::DrawCall &a, const MockCanvas::DrawCall &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawCall &draw)
 
bool operator== (const MockCanvas::DrawPaint &a, const MockCanvas::DrawPaint &b)
 
std::ostream & operator<< (std::ostream &os, const MockCanvas::DrawPaint &data)
 
 TEST_F (MockCanvasTest, DrawRRectDies)
 
 TEST_F (MockCanvasTest, DrawCalls)
 
void PostTaskSync (fml::RefPtr< fml::TaskRunner > task_runner, const std::function< void()> &function)
 
static const uint8_t * DartNativeEntrySymbolCallback (Dart_NativeFunction function)
 
static std::string GetEGLError ()
 
template<class T >
auto WeakPtr (std::shared_ptr< T > pointer)
 
static std::string GetTestNameFromTestInfo (const ::testing::TestInfo &test_info)
 
std::string GetCurrentTestName ()
 Gets the name of the currently running test. This is useful in generating logs or assets based on test name. More...
 
std::string GetDefaultKernelFilePath ()
 Returns the default path to kernel_blob.bin. This file is within the directory returned by GetFixturesPath(). More...
 
fml::UniqueFD OpenFixturesDirectory ()
 Opens the fixtures directory for the unit-test harness. More...
 
fml::UniqueFD OpenFixture (std::string fixture_name)
 Opens a fixture of the given file name. More...
 
std::unique_ptr< fml::MappingOpenFixtureAsMapping (std::string fixture_name)
 Opens a fixture of the given file name and returns a mapping to its contents. More...
 
bool MemsetPatternSetOrCheck (uint8_t *buffer, size_t size, MemsetPatternOp op)
 Depending on the operation, either scribbles a known pattern into the buffer or checks if that pattern is present in an existing buffer. This is a portable variant of the memset_pattern class of methods that also happen to do assert that the same pattern exists. More...
 
bool MemsetPatternSetOrCheck (std::vector< uint8_t > &buffer, MemsetPatternOp op)
 
const char * GetFixturesPath ()
 Returns the directory containing the test fixture for the target if this target has fixtures configured. If there are no fixtures, this is a link error. If you see a linker error on this symbol, the unit-test target needs to depend on a test_fixtures target. More...
 
const char * GetTestingAssetsPath ()
 Returns the directory containing assets shared across all tests. More...
 
 TEST_F (DartPersistentHandleTest, ClearAfterShutdown)
 
 TEST_F (DartState, IsShuttingDown)
 
 TEST_F (DartWeakPersistentHandle, ClearImmediately)
 
 TEST_F (DartWeakPersistentHandle, ClearLaterCc)
 
 TEST_F (DartWeakPersistentHandle, ClearLaterDart)
 
 TEST_F (DartWeakPersistentHandle, ClearOnShutdown)
 

Variables

constexpr int TestWidth = 200
 
constexpr int TestHeight = 200
 
constexpr int RenderWidth = 100
 
constexpr int RenderHeight = 100
 
constexpr int RenderHalfWidth = 50
 
constexpr int RenderHalfHeight = 50
 
constexpr int RenderLeft = (TestWidth - RenderWidth) / 2
 
constexpr int RenderTop = (TestHeight - RenderHeight) / 2
 
constexpr int RenderRight = RenderLeft + RenderWidth
 
constexpr int RenderBottom = RenderTop + RenderHeight
 
constexpr int RenderCenterX = (RenderLeft + RenderRight) / 2
 
constexpr int RenderCenterY = (RenderTop + RenderBottom) / 2
 
constexpr SkScalar RenderRadius = std::min(RenderWidth, RenderHeight) / 2.0
 
constexpr SkScalar RenderCornerRadius = RenderRadius / 5.0
 
constexpr SkPoint TestCenter = SkPoint::Make(TestWidth / 2, TestHeight / 2)
 
constexpr SkRect TestBounds = SkRect::MakeWH(TestWidth, TestHeight)
 
constexpr SkRect RenderBounds
 
constexpr SkScalar MiterExtremeDiamondOffsetX = RenderHeight * 0.04
 
constexpr SkScalar Miter10DiamondOffsetX = RenderHeight * 0.051
 
constexpr SkScalar Miter4DiamondOffsetX = RenderHeight * 0.14
 
constexpr SkScalar MiterExtremeDiamondOffsetY = RenderWidth * 0.04
 
constexpr SkScalar Miter10DiamondOffsetY = RenderWidth * 0.051
 
constexpr SkScalar Miter4DiamondOffsetY = RenderWidth * 0.14
 
constexpr SkScalar x_off_0 = RenderCenterX
 
constexpr SkScalar x_off_l1 = RenderCenterX - Miter4DiamondOffsetX
 
constexpr SkScalar x_off_l2 = x_off_l1 - Miter10DiamondOffsetX
 
constexpr SkScalar x_off_l3 = x_off_l2 - Miter10DiamondOffsetX
 
constexpr SkScalar x_off_r1 = RenderCenterX + Miter4DiamondOffsetX
 
constexpr SkScalar x_off_r2 = x_off_r1 + MiterExtremeDiamondOffsetX
 
constexpr SkScalar x_off_r3 = x_off_r2 + MiterExtremeDiamondOffsetX
 
constexpr SkPoint VerticalMiterDiamondPoints []
 
const int VerticalMiterDiamondPointCount
 
constexpr SkScalar y_off_0 = RenderCenterY
 
constexpr SkScalar y_off_u1 = RenderCenterY - Miter4DiamondOffsetY
 
constexpr SkScalar y_off_u2 = y_off_u1 - Miter10DiamondOffsetY
 
constexpr SkScalar y_off_u3 = y_off_u2 - Miter10DiamondOffsetY
 
constexpr SkScalar y_off_d1 = RenderCenterY + Miter4DiamondOffsetY
 
constexpr SkScalar y_off_d2 = y_off_d1 + MiterExtremeDiamondOffsetY
 
constexpr SkScalar y_off_d3 = y_off_d2 + MiterExtremeDiamondOffsetY
 
const SkPoint HorizontalMiterDiamondPoints []
 
const int HorizontalMiterDiamondPointCount
 
constexpr SkPoint end_points []
 
constexpr SkColor colors []
 
constexpr float stops []
 
constexpr float rotate_color_matrix [20]
 
constexpr float invert_color_matrix [20]
 
const SkScalar TestDashes1 [] = {4.0, 2.0}
 
const SkScalar TestDashes2 [] = {1.0, 1.5}
 
constexpr SkPoint TestPoints []
 
static const sk_sp< SkBlender > TestBlender1
 
static const sk_sp< SkBlender > TestBlender2
 
static const sk_sp< SkBlender > TestBlender3
 
static const sk_sp< SkShader > TestShader1
 
static const sk_sp< SkShader > TestShader2
 
static const sk_sp< SkShader > TestShader3
 
static const sk_sp< SkImageFilter > TestImageFilter1
 
static const sk_sp< SkImageFilter > TestImageFilter2
 
static const sk_sp< SkColorFilter > TestColorFilter1
 
static const sk_sp< SkColorFilter > TestColorFilter2
 
static const sk_sp< SkPathEffect > TestPathEffect1
 
static const sk_sp< SkPathEffect > TestPathEffect2
 
static const sk_sp< SkMaskFilter > TestMaskFilter
 
static const SkRRect TestRRect = SkRRect::MakeRectXY(TestBounds, 5, 5)
 
static const SkRRect TestRRectRect = SkRRect::MakeRect(TestBounds)
 
static const SkRRect TestInnerRRect
 
static const SkPath TestPathRect = SkPath::Rect(TestBounds)
 
static const SkPath TestPathOval = SkPath::Oval(TestBounds)
 
static const SkPath TestPath1
 
static const SkPath TestPath2
 
static const SkPath TestPath3
 
static const SkMatrix TestMatrix1 = SkMatrix::Scale(2, 2)
 
static const SkMatrix TestMatrix2 = SkMatrix::RotateDeg(45)
 
static sk_sp< SkImage > TestImage1 = MakeTestImage(40, 40, 5)
 
static sk_sp< SkImage > TestImage2 = MakeTestImage(50, 50, 5)
 
static sk_sp< SkVertices > TestVertices1
 
static sk_sp< SkVertices > TestVertices2
 
static constexpr int TestDivs1 [] = {10, 20, 30}
 
static constexpr int TestDivs2 [] = {15, 20, 25}
 
static constexpr int TestDivs3 [] = {15, 25}
 
static constexpr SkCanvas::Lattice::RectType TestRTypes []
 
static constexpr SkColor TestLatticeColors []
 
static constexpr SkIRect TestLatticeSrcRect = {1, 1, 39, 39}
 
static sk_sp< SkPicture > TestPicture1 = MakeTestPicture(20, 20, SK_ColorGREEN)
 
static sk_sp< SkPicture > TestPicture2 = MakeTestPicture(25, 25, SK_ColorBLUE)
 
static sk_sp< DisplayListTestDisplayList1
 
static sk_sp< DisplayListTestDisplayList2
 
static sk_sp< SkTextBlob > TestBlob1 = MakeTextBlob("TestBlob1")
 
static sk_sp< SkTextBlob > TestBlob2 = MakeTextBlob("TestBlob2")
 
std::vector< DisplayListInvocationGroupallGroups
 
FML_THREAD_LOCAL fml::ThreadLocalUniquePtr< int > current_context
 
const std::string kernel_file_name = "no_plugin_registrant_kernel_blob.bin"
 
const std::string elf_file_name = "no_plugin_registrant_app_elf_snapshot.so"
 
constexpr uint64_t kScanCodeKeyA = 0x1e
 
constexpr uint64_t kVirtualKeyA = 0x41
 
static MockKeyEventChannelHandler stored_channel_handler
 
static MockKeyEventEmbedderHandler stored_embedder_handler
 
constexpr LRESULT kWmResultZero = 0
 
constexpr LRESULT kWmResultDefault = 0xDEADC0DE
 
constexpr LRESULT kWmResultDontCheck = 0xFFFF1234
 
constexpr const char * kDefaultAOTAppELFFileName = "app_elf_snapshot.so"
 
constexpr const char * kDefaultAOTAppELFSplitFileName
 
constexpr SkISize kSize = SkISize::Make(64, 64)
 
static constexpr SkRect kEmptyRect = SkRect::MakeEmpty()
 
static std::mutex gIsolateResolversMutex
 
static std::map< Dart_Isolate, std::weak_ptr< TestDartNativeResolver > > gIsolateResolvers
 
tonic::DartWeakPersistentValue global_weak_persistent_value
 

Typedef Documentation

◆ AutoSaveLayerTests

◆ BackdropFilterLayerTest

◆ CanvasTest

using flutter::testing::CanvasTest = typedef CanvasTestBase<::testing::Test>

Definition at line 28 of file canvas_test.h.

◆ CheckerBoardLayerTest

◆ ClipPathLayerTest

◆ ClipRectLayerTest

◆ ClipRRectLayerTest

◆ ColorFilterLayerTest

◆ ContainerLayerTest

◆ Continuation

◆ CreateVsyncWaiter

using flutter::testing::CreateVsyncWaiter = typedef std::function<std::unique_ptr<VsyncWaiter>()>

Definition at line 15 of file vsync_waiters_test.h.

◆ DartLifecycleTest

◆ DartState

Definition at line 13 of file dart_state_unittest.cc.

◆ DartVMTest

Definition at line 14 of file dart_vm_unittests.cc.

◆ DisplayListLayerTest

◆ DlInvoker

◆ Embedder11yTest

◆ EmbedderTest

◆ Generator

Definition at line 17 of file input_events_unittests.cc.

◆ HooksTest

Definition at line 18 of file hooks_unittests.cc.

◆ ImageFilterLayerTest

◆ IntPipeline

Definition at line 18 of file pipeline_unittests.cc.

◆ LayerTest

using flutter::testing::LayerTest = typedef LayerTestBase<::testing::Test>

Definition at line 151 of file layer_test.h.

◆ LogMessageCallback

using flutter::testing::LogMessageCallback = typedef std::function<void(const char* tag, const char* message)>

Definition at line 31 of file embedder_test_context.h.

◆ MockCanvasTest

Definition at line 13 of file mock_canvas_unittests.cc.

◆ MockKeyEventChannelHandler

◆ MockKeyEventEmbedderHandler

◆ MockLayerTest

Definition at line 14 of file mock_layer_unittests.cc.

◆ NativeEntry

using flutter::testing::NativeEntry = typedef std::function<void(Dart_NativeArguments)>

Definition at line 28 of file test_dart_native_resolver.h.

◆ OpacityLayerTest

Definition at line 17 of file opacity_layer_unittests.cc.

◆ PerformanceOverlayLayerTest

◆ PersistentCacheTest

◆ PhysicalShapeLayerTest

◆ PictureLayerTest

◆ PlatformViewLayerTest

◆ SemanticsActionCallback

◆ SemanticsNodeCallback

◆ SemanticsUpdateBuilderTest

◆ ShaderMaskLayerTest

◆ TextureLayerTest

Definition at line 16 of file texture_layer_unittests.cc.

◆ TransformLayerTest

◆ UniqueAOTData

Definition at line 41 of file embedder_test_context.h.

◆ UniqueEngine

◆ UniqueLoadedELF

using flutter::testing::UniqueLoadedELF = typedef std::unique_ptr<Dart_LoadedElf, LoadedELFDeleter>

Definition at line 31 of file elf_loader.h.

◆ UnitlessTime

using flutter::testing::UnitlessTime = typedef int

Definition at line 13 of file input_events_unittests.cc.

Enumeration Type Documentation

◆ DebuggerStatus

Enumerator
kDontKnow 
kAttached 

Definition at line 13 of file debugger_detection.h.

◆ EmbedderTestContextType

◆ MemsetPatternOp

◆ WmFieldContext

Enumerator
kNoContext 
kAltHeld 

Definition at line 34 of file wm_builders.h.

◆ WmFieldExtended

Enumerator
kNotExtended 
kExtended 

Definition at line 29 of file wm_builders.h.

◆ WmFieldPrevState

Enumerator
kWasUp 
kWasDown 

Definition at line 39 of file wm_builders.h.

◆ WmFieldTransitionState

Enumerator
kBeingReleased 
kBeingPressed 

Definition at line 44 of file wm_builders.h.

Function Documentation

◆ _EventEquals()

testing::AssertionResult flutter::testing::_EventEquals ( const char *  expr_event,
const char *  expr_expected,
const FlutterKeyEvent event,
const FlutterKeyEvent expected 
)

Definition at line 58 of file test_keyboard.cc.

References _RETURN_IF_NOT_EQUALS, FlutterKeyEvent::character, FlutterKeyEvent::logical, FlutterKeyEvent::physical, FlutterKeyEvent::struct_size, FlutterKeyEvent::synthesized, and FlutterKeyEvent::type.

61  {
63  _RETURN_IF_NOT_EQUALS(event.type, expected.type);
64  _RETURN_IF_NOT_EQUALS(event.physical, expected.physical);
65  _RETURN_IF_NOT_EQUALS(event.logical, expected.logical);
66  if ((event.character == nullptr) != (expected.character == nullptr) ||
67  strcmp(event.character, expected.character) != 0) {
68  return ::testing::AssertionFailure()
69  << "Expected equality of these values:\n expected.character\n "
70  << _print_character(expected.character) << "\n Actual: \n "
71  << _print_character(event.character);
72  }
74  return ::testing::AssertionSuccess();
75 }
const char * character
Definition: embedder.h:732
#define _RETURN_IF_NOT_EQUALS(val1, val2)
uint64_t logical
Definition: embedder.h:729
uint64_t physical
Definition: embedder.h:721
size_t struct_size
The size of this struct. Must be sizeof(FlutterKeyEvent).
Definition: embedder.h:707
bool synthesized
Definition: embedder.h:745
FlutterKeyEventType type
The event kind.
Definition: embedder.h:713

◆ Build()

static sk_sp<DisplayList> flutter::testing::Build ( size_t  g_index,
size_t  v_index 
)
static

Definition at line 855 of file display_list_unittests.cc.

References flutter::DisplayListBuilder::Build(), flutter::testing::DisplayListInvocation::byte_count(), flutter::testing::DisplayListInvocation::invoker, flutter::name, flutter::testing::DisplayListInvocation::op_count(), flutter::testing::DisplayListInvocation::raw_byte_count(), and flutter::testing::DisplayListInvocationGroup::variants.

Referenced by flutter::DisplayListCanvasRecorder::builder(), and flutter_runner::testing::TEST_F().

855  {
856  DisplayListBuilder builder;
857  int op_count = 0;
858  size_t byte_count = 0;
859  for (size_t i = 0; i < allGroups.size(); i++) {
860  DisplayListInvocationGroup& group = allGroups[i];
861  size_t j = (i == g_index ? v_index : 0);
862  if (j >= group.variants.size())
863  continue;
864  DisplayListInvocation& invocation = group.variants[j];
865  op_count += invocation.op_count();
866  byte_count += invocation.raw_byte_count();
867  invocation.invoker(builder);
868  }
869  sk_sp<DisplayList> dl = builder.Build();
870  std::string name;
871  if (g_index >= allGroups.size()) {
872  name = "Default";
873  } else {
874  name = allGroups[g_index].op_name;
875  if (v_index < 0) {
876  name += " skipped";
877  } else {
878  name += " variant " + std::to_string(v_index + 1);
879  }
880  }
881  EXPECT_EQ(dl->op_count(false), op_count) << name;
882  EXPECT_EQ(dl->bytes(false), byte_count + sizeof(DisplayList)) << name;
883  return dl;
884 }
std::vector< DisplayListInvocationGroup > allGroups
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ CheckFrameTimings()

static void flutter::testing::CheckFrameTimings ( const std::vector< FrameTiming > &  timings,
fml::TimePoint  start,
fml::TimePoint  finish 
)
static

Definition at line 556 of file shell_unittests.cc.

References flutter::FrameTiming::kPhases, and flutter::FrameTiming::kRasterFinishWallTime.

Referenced by TEST_F().

558  {
559  fml::TimePoint last_frame_start;
560  for (size_t i = 0; i < timings.size(); i += 1) {
561  // Ensure that timings are sorted.
562  ASSERT_TRUE(timings[i].Get(FrameTiming::kPhases[0]) >= last_frame_start);
563  last_frame_start = timings[i].Get(FrameTiming::kPhases[0]);
564 
565  fml::TimePoint last_phase_time;
566  for (auto phase : FrameTiming::kPhases) {
567  // raster finish wall time doesn't use the same clock base
568  // as rest of the frame timings.
569  if (phase == FrameTiming::kRasterFinishWallTime) {
570  continue;
571  }
572 
573  ASSERT_TRUE(timings[i].Get(phase) >= start);
574  ASSERT_TRUE(timings[i].Get(phase) <= finish);
575 
576  // phases should have weakly increasing time points
577  ASSERT_TRUE(last_phase_time <= timings[i].Get(phase));
578  last_phase_time = timings[i].Get(phase);
579  }
580  }
581 }

◆ CheckTextSkData()

static void flutter::testing::CheckTextSkData ( sk_sp< SkData >  data,
const std::string &  expected 
)
static

Definition at line 198 of file persistent_cache_unittests.cc.

Referenced by TEST_F().

198  {
199  std::string data_string(reinterpret_cast<const char*>(data->bytes()),
200  data->size());
201  ASSERT_EQ(data_string, expected);
202 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ CheckTwoSkSLsAreLoaded()

static void flutter::testing::CheckTwoSkSLsAreLoaded ( )
static

Definition at line 209 of file persistent_cache_unittests.cc.

References flutter::PersistentCache::GetCacheForProcess(), and flutter::PersistentCache::LoadSkSLs().

Referenced by TEST_F().

209  {
210  auto shaders = PersistentCache::GetCacheForProcess()->LoadSkSLs();
211  ASSERT_EQ(shaders.size(), 2u);
212 }

◆ clone_string()

char * flutter::testing::clone_string ( const char *  string)

Definition at line 15 of file test_keyboard.cc.

References flutter::MessageCodec< T >::EncodeMessage(), flutter::JsonMessageCodec::GetInstance(), and result.

Referenced by TEST().

15  {
16  if (string == nullptr) {
17  return nullptr;
18  }
19  size_t len = strlen(string);
20  char* result = new char[len + 1];
21  strcpy(result, string);
22  return result;
23 }
GAsyncResult * result

◆ CreateAndRunRootIsolate()

static std::shared_ptr<DartIsolate> flutter::testing::CreateAndRunRootIsolate ( const Settings settings,
const DartVMData vm,
fml::RefPtr< fml::TaskRunner task_runner,
std::string  entrypoint 
)
static

Definition at line 46 of file dart_lifecycle_unittests.cc.

References flutter::UIDartState::Context::advisory_script_entrypoint, flutter::UIDartState::Context::advisory_script_uri, flutter::DartIsolate::CreateRunningRootIsolate(), FML_CHECK, FML_LOG, flutter::DartVMData::GetIsolateSnapshot(), flutter::DartVMData::GetSettings(), flutter::IsolateConfiguration::InferFromSettings(), flutter::Settings::isolate_create_callback, and flutter::Settings::isolate_shutdown_callback.

Referenced by TEST_F().

50  {
51  FML_CHECK(entrypoint.size() > 0);
52  TaskRunners runners("io.flutter.test", task_runner, task_runner, task_runner,
53  task_runner);
54 
55  auto isolate_configuration =
56  IsolateConfiguration::InferFromSettings(settings);
57 
58  UIDartState::Context context(runners);
59  context.advisory_script_uri = "main.dart";
60  context.advisory_script_entrypoint = entrypoint.c_str();
61  auto isolate =
62  DartIsolate::CreateRunningRootIsolate(
63  vm.GetSettings(), // settings
64  vm.GetIsolateSnapshot(), // isolate_snapshot
65  {}, // platform configuration
66  DartIsolate::Flags{}, // flags
67  nullptr, // root isolate create callback
68  settings.isolate_create_callback, // isolate create callback
69  settings.isolate_shutdown_callback, // isolate shutdown callback,
70  entrypoint, // dart entrypoint
71  std::nullopt, // dart entrypoint library
72  std::move(isolate_configuration), // isolate configuration
73  std::move(context) // engine context
74  )
75  .lock();
76 
77  if (!isolate) {
78  FML_LOG(ERROR) << "Could not launch the root isolate.";
79  return nullptr;
80  }
81 
82  return isolate;
83 }
#define FML_LOG(severity)
Definition: logging.h:65
#define FML_CHECK(condition)
Definition: logging.h:68

◆ CreateFlagsString()

static std::string flutter::testing::CreateFlagsString ( std::vector< const char *> &  flags)
static

Definition at line 228 of file shell_unittests.cc.

Referenced by TestDartVmFlags().

228  {
229  if (flags.size() == 0) {
230  return "";
231  }
232  std::string flags_string = flags[0];
233  for (size_t i = 1; i < flags.size(); ++i) {
234  flags_string += ",";
235  flags_string += flags[i];
236  }
237  return flags_string;
238 }
FlutterSemanticsFlag flags

◆ CreateKeyEventLparam()

LPARAM flutter::testing::CreateKeyEventLparam ( USHORT  scancode,
bool  extended,
bool  was_down,
USHORT  repeat_count,
bool  context_code,
bool  transition_state 
)

Definition at line 77 of file test_keyboard.cc.

Referenced by TEST().

82  {
83  return ((LPARAM(transition_state) << 31) | (LPARAM(was_down) << 30) |
84  (LPARAM(context_code) << 29) | (LPARAM(extended ? 0x1 : 0x0) << 24) |
85  (LPARAM(scancode) << 16) | LPARAM(repeat_count));
86 }
LONG_PTR LPARAM
Definition: windows_types.h:60

◆ CreateMockViewController()

id flutter::testing::CreateMockViewController ( NSString *  pasteboardString)

Definition at line 9 of file FlutterViewControllerTestUtils.mm.

References GetFixturesPath(), and viewController.

Referenced by TEST().

9  {
10  {
11  NSString* fixtures = @(testing::GetFixturesPath());
12  FlutterDartProject* project = [[FlutterDartProject alloc]
13  initWithAssetsPath:fixtures
14  ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
15  FlutterViewController* viewController = [[FlutterViewController alloc] initWithProject:project];
16 
17  // Mock pasteboard so that this test will work in environments without a
18  // real pasteboard.
19  id pasteboardMock = OCMClassMock([NSPasteboard class]);
20  OCMExpect([pasteboardMock stringForType:[OCMArg any]]).andDo(^(NSInvocation* invocation) {
21  NSString* returnValue = pasteboardString.length > 0 ? pasteboardString : nil;
22  [invocation setReturnValue:&returnValue];
23  });
24  id viewControllerMock = OCMPartialMock(viewController);
25  OCMStub([viewControllerMock pasteboard]).andReturn(pasteboardMock);
26  return viewControllerMock;
27  }
28 }
FlutterViewController * viewController
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...

◆ CreateOffscreenTexture()

static fml::scoped_nsprotocol<id<MTLTexture> > flutter::testing::CreateOffscreenTexture ( id< MTLDevice >  device)
static

Definition at line 16 of file shell_test_platform_view_metal.mm.

References height, and width.

16  {
17  auto descriptor =
18  [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:MTLPixelFormatBGRA8Unorm
19  width:800
20  height:600
21  mipmapped:NO];
22  descriptor.usage = MTLTextureUsageRenderTarget | MTLTextureUsageShaderRead;
23  return fml::scoped_nsprotocol<id<MTLTexture>>{[device newTextureWithDescriptor:descriptor]};
24 }
int32_t width
int32_t height

◆ CreateRenderSurface()

sk_sp< SkSurface > flutter::testing::CreateRenderSurface ( const FlutterLayer layer,
GrDirectContext *  context 
)

Definition at line 14 of file embedder_unittests_util.cc.

References FML_CHECK, FlutterSize::height, FlutterLayer::size, and FlutterSize::width.

Referenced by TEST_F().

15  {
16  const auto image_info =
17  SkImageInfo::MakeN32Premul(layer.size.width, layer.size.height);
18  auto surface = context ? SkSurface::MakeRenderTarget(
19  context, // context
20  SkBudgeted::kNo, // budgeted
21  image_info, // image info
22  1, // sample count
23  kTopLeft_GrSurfaceOrigin, // surface origin
24  nullptr, // surface properties
25  false // mipmaps
26 
27  )
28  : SkSurface::MakeRaster(image_info);
29  FML_CHECK(surface != nullptr);
30  return surface;
31 }
FlutterSize size
The size of the layer (in physical pixels).
Definition: embedder.h:1108
double width
Definition: embedder.h:320
#define FML_CHECK(condition)
Definition: logging.h:68
double height
Definition: embedder.h:321

◆ CreateSimulatedMousePointerData()

void flutter::testing::CreateSimulatedMousePointerData ( PointerData data,
PointerData::Change  change,
PointerData::SignalKind  signal_kind,
int64_t  device,
double  dx,
double  dy,
double  scroll_delta_x,
double  scroll_delta_y,
int64_t  buttons 
)

Definition at line 50 of file pointer_data_packet_converter_unittests.cc.

References flutter::PointerData::buttons, flutter::PointerData::change, flutter::PointerData::device, flutter::PointerData::distance, flutter::PointerData::distance_max, flutter::PointerData::kind, flutter::PointerData::kMouse, flutter::PointerData::obscured, flutter::PointerData::orientation, flutter::PointerData::physical_delta_x, flutter::PointerData::physical_delta_y, flutter::PointerData::physical_x, flutter::PointerData::physical_y, flutter::PointerData::platformData, flutter::PointerData::pointer_identifier, flutter::PointerData::pressure, flutter::PointerData::pressure_max, flutter::PointerData::pressure_min, flutter::PointerData::radius_major, flutter::PointerData::radius_max, flutter::PointerData::radius_min, flutter::PointerData::radius_minor, flutter::PointerData::scroll_delta_x, flutter::PointerData::scroll_delta_y, flutter::PointerData::signal_kind, flutter::PointerData::size, flutter::PointerData::synthesized, flutter::PointerData::tilt, and flutter::PointerData::time_stamp.

Referenced by TEST().

58  {
59  data.time_stamp = 0;
60  data.change = change;
61  data.kind = PointerData::DeviceKind::kMouse;
62  data.signal_kind = signal_kind;
63  data.device = device;
64  data.pointer_identifier = 0;
65  data.physical_x = dx;
66  data.physical_y = dy;
67  data.physical_delta_x = 0.0;
68  data.physical_delta_y = 0.0;
69  data.buttons = buttons;
70  data.obscured = 0;
71  data.synthesized = 0;
72  data.pressure = 0.0;
73  data.pressure_min = 0.0;
74  data.pressure_max = 0.0;
75  data.distance = 0.0;
76  data.distance_max = 0.0;
77  data.size = 0.0;
78  data.radius_major = 0.0;
79  data.radius_minor = 0.0;
80  data.radius_min = 0.0;
81  data.radius_max = 0.0;
82  data.orientation = 0.0;
83  data.tilt = 0.0;
84  data.platformData = 0;
85  data.scroll_delta_x = scroll_delta_x;
86  data.scroll_delta_y = scroll_delta_y;
87 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ CreateSimulatedPointerData() [1/2]

void flutter::testing::CreateSimulatedPointerData ( PointerData data,
PointerData::Change  change,
int64_t  device,
double  dx,
double  dy,
int64_t  buttons 
)

Definition at line 14 of file pointer_data_packet_converter_unittests.cc.

References flutter::PointerData::buttons, flutter::PointerData::change, flutter::PointerData::device, flutter::PointerData::distance, flutter::PointerData::distance_max, flutter::PointerData::kind, flutter::PointerData::kNone, flutter::PointerData::kTouch, flutter::PointerData::obscured, flutter::PointerData::orientation, flutter::PointerData::physical_delta_x, flutter::PointerData::physical_delta_y, flutter::PointerData::physical_x, flutter::PointerData::physical_y, flutter::PointerData::platformData, flutter::PointerData::pointer_identifier, flutter::PointerData::pressure, flutter::PointerData::pressure_max, flutter::PointerData::pressure_min, flutter::PointerData::radius_major, flutter::PointerData::radius_max, flutter::PointerData::radius_min, flutter::PointerData::radius_minor, flutter::PointerData::scroll_delta_x, flutter::PointerData::scroll_delta_y, flutter::PointerData::signal_kind, flutter::PointerData::size, flutter::PointerData::synthesized, flutter::PointerData::tilt, and flutter::PointerData::time_stamp.

Referenced by TEST(), and TEST_F().

19  {
20  data.time_stamp = 0;
21  data.change = change;
22  data.kind = PointerData::DeviceKind::kTouch;
24  data.device = device;
25  data.pointer_identifier = 0;
26  data.physical_x = dx;
27  data.physical_y = dy;
28  data.physical_delta_x = 0.0;
29  data.physical_delta_y = 0.0;
30  data.buttons = buttons;
31  data.obscured = 0;
32  data.synthesized = 0;
33  data.pressure = 0.0;
34  data.pressure_min = 0.0;
35  data.pressure_max = 0.0;
36  data.distance = 0.0;
37  data.distance_max = 0.0;
38  data.size = 0.0;
39  data.radius_major = 0.0;
40  data.radius_minor = 0.0;
41  data.radius_min = 0.0;
42  data.radius_max = 0.0;
43  data.orientation = 0.0;
44  data.tilt = 0.0;
45  data.platformData = 0;
46  data.scroll_delta_x = 0.0;
47  data.scroll_delta_y = 0.0;
48 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ CreateSimulatedPointerData() [2/2]

void flutter::testing::CreateSimulatedPointerData ( PointerData data,
PointerData::Change  change,
double  dx,
double  dy 
)

Definition at line 144 of file input_events_unittests.cc.

References flutter::PointerData::buttons, flutter::PointerData::change, flutter::PointerData::device, flutter::PointerData::distance, flutter::PointerData::distance_max, flutter::PointerData::kind, flutter::PointerData::kNone, flutter::PointerData::kTouch, flutter::PointerData::obscured, flutter::PointerData::orientation, flutter::PointerData::physical_delta_x, flutter::PointerData::physical_delta_y, flutter::PointerData::physical_x, flutter::PointerData::physical_y, flutter::PointerData::platformData, flutter::PointerData::pointer_identifier, flutter::PointerData::pressure, flutter::PointerData::pressure_max, flutter::PointerData::pressure_min, flutter::PointerData::radius_major, flutter::PointerData::radius_max, flutter::PointerData::radius_min, flutter::PointerData::radius_minor, flutter::PointerData::scroll_delta_x, flutter::PointerData::scroll_delta_y, flutter::PointerData::signal_kind, flutter::PointerData::size, flutter::PointerData::synthesized, flutter::PointerData::tilt, and flutter::PointerData::time_stamp.

147  {
148  data.time_stamp = 0;
149  data.change = change;
150  data.kind = PointerData::DeviceKind::kTouch;
151  data.signal_kind = PointerData::SignalKind::kNone;
152  data.device = 0;
153  data.pointer_identifier = 0;
154  data.physical_x = dx;
155  data.physical_y = dy;
156  data.physical_delta_x = 0.0;
157  data.physical_delta_y = 0.0;
158  data.buttons = 0;
159  data.obscured = 0;
160  data.synthesized = 0;
161  data.pressure = 0.0;
162  data.pressure_min = 0.0;
163  data.pressure_max = 0.0;
164  data.distance = 0.0;
165  data.distance_max = 0.0;
166  data.size = 0.0;
167  data.radius_major = 0.0;
168  data.radius_minor = 0.0;
169  data.radius_min = 0.0;
170  data.radius_max = 0.0;
171  data.orientation = 0.0;
172  data.tilt = 0.0;
173  data.platformData = 0;
174  data.scroll_delta_x = 0.0;
175  data.scroll_delta_y = 0.0;
176 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ CreateSurfaceManager()

static FlutterMetalSurfaceManager* flutter::testing::CreateSurfaceManager ( )
static

Definition at line 32 of file FlutterMetalSurfaceManagerTest.mm.

Referenced by TEST().

32  {
33  id<MTLDevice> device = MTLCreateSystemDefaultDevice();
34  id<MTLCommandQueue> commandQueue = [device newCommandQueue];
35  TestMetalView* metalView = [[TestMetalView alloc] init];
36  CALayer* layer = reinterpret_cast<CALayer*>(metalView.layer);
37  return [[FlutterMetalSurfaceManager alloc] initWithDevice:device
38  commandQueue:commandQueue
39  layer:layer];
40 }

◆ DartNativeEntrySymbolCallback()

static const uint8_t* flutter::testing::DartNativeEntrySymbolCallback ( Dart_NativeFunction  function)
static

Definition at line 63 of file test_dart_native_resolver.cc.

Referenced by flutter::testing::TestDartNativeResolver::SetNativeResolverForIsolate().

64  {
65  return reinterpret_cast<const uint8_t*>("¯\\_(ツ)_/¯");
66 }

◆ dLineTolerance()

BoundsTolerance flutter::testing::dLineTolerance ( const BoundsTolerance tolerance,
const SkPaint &  paint,
const SkMatrix &  matrix 
)

Definition at line 1496 of file display_list_canvas_unittests.cc.

References lineTolerance().

Referenced by TEST().

1498  {
1499  return lineTolerance(tolerance, paint, matrix, false, false, false);
1500 }
BoundsTolerance lineTolerance(const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix, bool is_horizontal, bool is_vertical, bool ignores_butt_cap)

◆ ExpectKeyEventEq()

void flutter::testing::ExpectKeyEventEq ( const FlutterKeyEvent subject,
const FlutterKeyEvent baseline 
)

Definition at line 1328 of file embedder_unittests.cc.

References FlutterKeyEvent::logical, FlutterKeyEvent::physical, FlutterKeyEvent::synthesized, FlutterKeyEvent::timestamp, and FlutterKeyEvent::type.

Referenced by TEST_F().

1329  {
1330  EXPECT_EQ(subject.timestamp, baseline.timestamp);
1331  EXPECT_EQ(subject.type, baseline.type);
1332  EXPECT_EQ(subject.physical, baseline.physical);
1333  EXPECT_EQ(subject.logical, baseline.logical);
1334  EXPECT_EQ(subject.synthesized, baseline.synthesized);
1335 }
uint64_t logical
Definition: embedder.h:729
uint64_t physical
Definition: embedder.h:721
bool synthesized
Definition: embedder.h:745
FlutterKeyEventType type
The event kind.
Definition: embedder.h:713
double timestamp
Definition: embedder.h:711

◆ FilterMutationsByType() [1/2]

void flutter::testing::FilterMutationsByType ( const FlutterPlatformViewMutation **  mutations,
size_t  count,
FlutterPlatformViewMutationType  type,
std::function< void(const FlutterPlatformViewMutation &mutation)>  handler 
)

Definition at line 151 of file embedder_unittests_util.cc.

References FlutterPlatformViewMutation::type.

Referenced by FilterMutationsByType(), GetTotalMutationTransformationMatrix(), and TEST_F().

155  {
156  if (mutations == nullptr) {
157  return;
158  }
159 
160  for (size_t i = 0; i < count; ++i) {
161  const FlutterPlatformViewMutation* mutation = mutations[i];
162  if (mutation->type != type) {
163  continue;
164  }
165 
166  handler(*mutation);
167  }
168 }
KeyCallType type
FlutterPlatformViewMutationType type
The type of the mutation described by the subsequent union.
Definition: embedder.h:1009

◆ FilterMutationsByType() [2/2]

void flutter::testing::FilterMutationsByType ( const FlutterPlatformView view,
FlutterPlatformViewMutationType  type,
std::function< void(const FlutterPlatformViewMutation &mutation)>  handler 
)

Definition at line 170 of file embedder_unittests_util.cc.

References FilterMutationsByType(), FlutterPlatformView::mutations, and FlutterPlatformView::mutations_count.

173  {
175  handler);
176 }
KeyCallType type
size_t mutations_count
Definition: embedder.h:1027
void FilterMutationsByType(const FlutterPlatformView *view, FlutterPlatformViewMutationType type, std::function< void(const FlutterPlatformViewMutation &mutation)> handler)
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:1040

◆ GetCurrentTestName()

std::string flutter::testing::GetCurrentTestName ( )

Gets the name of the currently running test. This is useful in generating logs or assets based on test name.

Returns
The current test name.

Definition at line 13 of file testing.cc.

Referenced by flutter::testing::TypeConversionsTest::RunWithEntrypoint(), flutter::testing::DartWeakPersistentHandle::RunWithEntrypoint(), flutter_runner::testing::GfxExternalViewEmbedderTest::session_connection(), flutter::TEST(), TEST_F(), and flutter_runner::testing::TEST_F().

13  {
14  return ::testing::UnitTest::GetInstance()->current_test_info()->name();
15 }

◆ GetDebuggerStatus()

DebuggerStatus flutter::testing::GetDebuggerStatus ( )

Definition at line 25 of file debugger_detection.cc.

References FML_CHECK, kAttached, kDontKnow, and fml::size().

Referenced by main().

25  {
26 #if OS_MACOSX
27  // From Technical Q&A QA1361 Detecting the Debugger
28  // https://developer.apple.com/library/archive/qa/qa1361/_index.html
29  int management_info_base[4];
30  struct kinfo_proc info;
31  size_t size;
32 
33  // Initialize the flags so that, if sysctl fails for some bizarre
34  // reason, we get a predictable result.
35  info.kp_proc.p_flag = 0;
36 
37  // Initialize management_info_base, which tells sysctl the info we want, in
38  // this case we're looking for information about a specific process ID.
39  management_info_base[0] = CTL_KERN;
40  management_info_base[1] = KERN_PROC;
41  management_info_base[2] = KERN_PROC_PID;
42  management_info_base[3] = getpid();
43 
44  // Call sysctl.
45 
46  size = sizeof(info);
47  auto status =
48  ::sysctl(management_info_base,
49  sizeof(management_info_base) / sizeof(*management_info_base),
50  &info, &size, NULL, 0);
51  FML_CHECK(status == 0);
52 
53  // We're being debugged if the P_TRACED flag is set.
54  return ((info.kp_proc.p_flag & P_TRACED) != 0) ? DebuggerStatus::kAttached
55  : DebuggerStatus::kDontKnow;
56 
57 #elif OS_WIN
58  return ::IsDebuggerPresent() ? DebuggerStatus::kAttached
59  : DebuggerStatus::kDontKnow;
60 
61 #else
62  return DebuggerStatus::kDontKnow;
63 #endif
64 } // namespace testing
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
#define FML_CHECK(condition)
Definition: logging.h:68

◆ GetDefaultKernelFilePath()

std::string flutter::testing::GetDefaultKernelFilePath ( )

Returns the default path to kernel_blob.bin. This file is within the directory returned by GetFixturesPath().

Returns
The kernel file path.

Definition at line 17 of file testing.cc.

References GetFixturesPath(), and fml::paths::JoinPaths().

Referenced by flutter::BM_PlatformMessageResponseDartComplete(), flutter::testing::TypeConversionsTest::RunWithEntrypoint(), flutter::testing::DartWeakPersistentHandle::RunWithEntrypoint(), flutter::testing::DartPersistentHandleTest::RunWithEntrypoint(), flutter::testing::DartNativeBenchmarks::TearDown(), and TEST_F().

17  {
18  return fml::paths::JoinPaths({GetFixturesPath(), "kernel_blob.bin"});
19 }
std::string JoinPaths(std::initializer_list< std::string > components)
Definition: paths.cc:14
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...

◆ GetEGLError()

static std::string flutter::testing::GetEGLError ( )
static

Definition at line 22 of file test_gl_surface.cc.

References error.

Referenced by flutter::testing::TestGLSurface::ClearCurrent(), flutter::testing::TestGLSurface::MakeCurrent(), flutter::testing::TestGLSurface::MakeResourceCurrent(), flutter::testing::TestGLSurface::Present(), flutter::testing::TestGLSurface::TestGLSurface(), and flutter::testing::TestGLSurface::~TestGLSurface().

22  {
23  std::stringstream stream;
24 
25  auto error = ::eglGetError();
26 
27  stream << "EGL Result: '";
28 
29  switch (error) {
30  case EGL_SUCCESS:
31  stream << "EGL_SUCCESS";
32  break;
33  case EGL_NOT_INITIALIZED:
34  stream << "EGL_NOT_INITIALIZED";
35  break;
36  case EGL_BAD_ACCESS:
37  stream << "EGL_BAD_ACCESS";
38  break;
39  case EGL_BAD_ALLOC:
40  stream << "EGL_BAD_ALLOC";
41  break;
42  case EGL_BAD_ATTRIBUTE:
43  stream << "EGL_BAD_ATTRIBUTE";
44  break;
45  case EGL_BAD_CONTEXT:
46  stream << "EGL_BAD_CONTEXT";
47  break;
48  case EGL_BAD_CONFIG:
49  stream << "EGL_BAD_CONFIG";
50  break;
51  case EGL_BAD_CURRENT_SURFACE:
52  stream << "EGL_BAD_CURRENT_SURFACE";
53  break;
54  case EGL_BAD_DISPLAY:
55  stream << "EGL_BAD_DISPLAY";
56  break;
57  case EGL_BAD_SURFACE:
58  stream << "EGL_BAD_SURFACE";
59  break;
60  case EGL_BAD_MATCH:
61  stream << "EGL_BAD_MATCH";
62  break;
63  case EGL_BAD_PARAMETER:
64  stream << "EGL_BAD_PARAMETER";
65  break;
66  case EGL_BAD_NATIVE_PIXMAP:
67  stream << "EGL_BAD_NATIVE_PIXMAP";
68  break;
69  case EGL_BAD_NATIVE_WINDOW:
70  stream << "EGL_BAD_NATIVE_WINDOW";
71  break;
72  case EGL_CONTEXT_LOST:
73  stream << "EGL_CONTEXT_LOST";
74  break;
75  default:
76  stream << "Unknown";
77  }
78 
79  stream << "' (0x" << std::hex << error << std::dec << ").";
80  return stream.str();
81 }
const uint8_t uint32_t uint32_t GError ** error

◆ GetFixturesPath()

const char* flutter::testing::GetFixturesPath ( )

◆ GetRasterizerResourceCacheBytesSync()

static size_t flutter::testing::GetRasterizerResourceCacheBytesSync ( const Shell shell)
static

Definition at line 1509 of file shell_unittests.cc.

References flutter::Shell::GetRasterizer(), flutter::TaskRunners::GetRasterTaskRunner(), flutter::Shell::GetTaskRunners(), fml::TaskRunner::RunNowOrPostTask(), fml::AutoResetWaitableEvent::Signal(), and fml::AutoResetWaitableEvent::Wait().

Referenced by TEST_F().

1509  {
1510  size_t bytes = 0;
1513  shell.GetTaskRunners().GetRasterTaskRunner(), [&]() {
1514  if (auto rasterizer = shell.GetRasterizer()) {
1515  bytes = rasterizer->GetResourceCacheMaxBytes().value_or(0U);
1516  }
1517  latch.Signal();
1518  });
1519  latch.Wait();
1520  return bytes;
1521 }
static void RunNowOrPostTask(fml::RefPtr< fml::TaskRunner > runner, const fml::closure &task)
Definition: task_runner.cc:55

◆ GetSamplePrerollContextHolder()

PrerollContextHolder flutter::testing::GetSamplePrerollContextHolder ( )

Definition at line 68 of file mock_raster_cache.cc.

References flutter::kGiantRect.

Referenced by flutter::testing::MockRasterCache::AddMockPicture(), and TEST().

68  {
69  Stopwatch raster_time;
70  Stopwatch ui_time;
71  MutatorsStack mutators_stack;
72  TextureRegistry texture_registry;
73  sk_sp<SkColorSpace> srgb = SkColorSpace::MakeSRGB();
74  PrerollContextHolder holder = {
75  {
76  nullptr, /* raster_cache */
77  nullptr, /* gr_context */
78  nullptr, /* external_view_embedder */
79  mutators_stack, srgb.get(), /* color_space */
80  kGiantRect, /* cull_rect */
81  false, /* layer reads from surface */
82  raster_time, ui_time, texture_registry,
83  false, /* checkerboard_offscreen_layers */
84  1.0f, /* frame_device_pixel_ratio */
85  false, /* has_platform_view */
86  },
87  srgb};
88 
89  return holder;
90 }
static constexpr SkRect kGiantRect
Definition: layer.h:37

◆ GetSurfaceFromTexture()

static sk_sp<SkSurface> flutter::testing::GetSurfaceFromTexture ( sk_sp< GrDirectContext >  skia_context,
SkISize  texture_size,
void *  texture 
)
static

Definition at line 53 of file embedder_unittests_metal.mm.

Referenced by TEST_F().

55  {
56  GrMtlTextureInfo info;
57  info.fTexture.reset([(id<MTLTexture>)texture retain]);
58  GrBackendTexture backend_texture(texture_size.width(), texture_size.height(), GrMipmapped::kNo,
59  info);
60 
61  return SkSurface::MakeFromBackendTexture(skia_context.get(), backend_texture,
62  kTopLeft_GrSurfaceOrigin, 1, kBGRA_8888_SkColorType,
63  nullptr, nullptr);
64 }
G_BEGIN_DECLS FlTexture * texture

◆ GetTestingAssetsPath()

const char* flutter::testing::GetTestingAssetsPath ( )

Returns the directory containing assets shared across all tests.

Returns
The testing assets path.

Referenced by flutter::testing::DartFixture::SetSnapshotsAndAssets().

◆ GetTestNameFromTestInfo()

static std::string flutter::testing::GetTestNameFromTestInfo ( const ::testing::TestInfo &  test_info)
static

Definition at line 86 of file test_timeout_listener.cc.

References flutter::name, fml::TimePoint::Now(), fml::TaskRunner::PostTask(), and WeakPtr().

87  {
88  std::stringstream stream;
89  stream << test_info.test_suite_name();
90  stream << ".";
91  stream << test_info.name();
92  if (auto type_param = test_info.type_param()) {
93  stream << "/" << type_param;
94  }
95  if (auto value_param = test_info.value_param()) {
96  stream << "/" << value_param;
97  }
98  return stream.str();
99 }

◆ GetThreadMergerFromPlatformThread()

fml::RefPtr<fml::RasterThreadMerger> flutter::testing::GetThreadMergerFromPlatformThread ( fml::Thread rasterizer_thread = nullptr)

Definition at line 62 of file external_view_embedder_unittests.cc.

References fml::MessageLoop::EnsureInitializedForCurrentThread(), and fml::MessageLoop::GetCurrentTaskQueueId().

Referenced by TEST().

63  {
64  // Assume the current thread is the platform thread.
66  auto platform_queue_id = fml::MessageLoop::GetCurrentTaskQueueId();
67 
68  if (!rasterizer_thread) {
69  return fml::MakeRefCounted<fml::RasterThreadMerger>(platform_queue_id,
70  platform_queue_id);
71  }
72  auto rasterizer_queue_id =
73  rasterizer_thread->GetTaskRunner()->GetTaskQueueId();
74  return fml::MakeRefCounted<fml::RasterThreadMerger>(platform_queue_id,
75  rasterizer_queue_id);
76 }
virtual TaskQueueId GetTaskQueueId()
Definition: task_runner.cc:38
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
Definition: thread.cc:45
static void EnsureInitializedForCurrentThread()
Definition: message_loop.cc:27
static TaskQueueId GetCurrentTaskQueueId()
Definition: message_loop.cc:76

◆ GetThreadMergerFromRasterThread()

fml::RefPtr<fml::RasterThreadMerger> flutter::testing::GetThreadMergerFromRasterThread ( fml::Thread platform_thread)

Definition at line 78 of file external_view_embedder_unittests.cc.

References fml::MessageLoop::EnsureInitializedForCurrentThread(), fml::MessageLoop::GetCurrentTaskQueueId(), fml::TaskRunner::GetTaskQueueId(), and fml::Thread::GetTaskRunner().

Referenced by TEST().

79  {
80  auto platform_queue_id = platform_thread->GetTaskRunner()->GetTaskQueueId();
81 
82  // Assume the current thread is the raster thread.
84  auto rasterizer_queue_id = fml::MessageLoop::GetCurrentTaskQueueId();
85 
86  return fml::MakeRefCounted<fml::RasterThreadMerger>(platform_queue_id,
87  rasterizer_queue_id);
88 }
virtual TaskQueueId GetTaskQueueId()
Definition: task_runner.cc:38
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
Definition: thread.cc:45
static void EnsureInitializedForCurrentThread()
Definition: message_loop.cc:27
static TaskQueueId GetCurrentTaskQueueId()
Definition: message_loop.cc:76

◆ GetTotalMutationTransformationMatrix() [1/2]

SkMatrix flutter::testing::GetTotalMutationTransformationMatrix ( const FlutterPlatformViewMutation **  mutations,
size_t  count 
)

Definition at line 178 of file embedder_unittests_util.cc.

References FilterMutationsByType(), kFlutterPlatformViewMutationTypeTransformation, and SkMatrixMake().

Referenced by GetTotalMutationTransformationMatrix(), and TEST_F().

180  {
181  SkMatrix collected;
182 
185  [&](const auto& mutation) {
186  collected.preConcat(SkMatrixMake(mutation.transformation));
187  });
188 
189  return collected;
190 }
SkMatrix SkMatrixMake(const FlutterTransformation &xformation)
void FilterMutationsByType(const FlutterPlatformView *view, FlutterPlatformViewMutationType type, std::function< void(const FlutterPlatformViewMutation &mutation)> handler)

◆ GetTotalMutationTransformationMatrix() [2/2]

SkMatrix flutter::testing::GetTotalMutationTransformationMatrix ( const FlutterPlatformView view)

Definition at line 192 of file embedder_unittests_util.cc.

References GetTotalMutationTransformationMatrix(), FlutterPlatformView::mutations, and FlutterPlatformView::mutations_count.

192  {
194  view->mutations_count);
195 }
size_t mutations_count
Definition: embedder.h:1027
const FlutterPlatformViewMutation ** mutations
Definition: embedder.h:1040
SkMatrix GetTotalMutationTransformationMatrix(const FlutterPlatformView *view)

◆ hLineTolerance()

BoundsTolerance flutter::testing::hLineTolerance ( const BoundsTolerance tolerance,
const SkPaint &  paint,
const SkMatrix &  matrix 
)

Definition at line 1482 of file display_list_canvas_unittests.cc.

References lineTolerance().

Referenced by TEST().

1484  {
1485  return lineTolerance(tolerance, paint, matrix, true, false, false);
1486 }
BoundsTolerance lineTolerance(const BoundsTolerance &tolerance, const SkPaint &paint, const SkMatrix &matrix, bool is_horizontal, bool is_vertical, bool ignores_butt_cap)

◆ ImageMatchesFixture() [1/2]

bool flutter::testing::ImageMatchesFixture ( const std::string &  fixture_file_name,
sk_sp< SkImage >  scene_image 
)

Definition at line 90 of file embedder_unittests_util.cc.

References FML_CHECK, FML_LOG, GetFixturesPath(), fml::FileMapping::GetMapping(), fml::FileMapping::GetSize(), fml::paths::JoinPaths(), OpenFixture(), OpenFixturesDirectory(), RasterImagesAreSame(), and WriteImageToDisk().

Referenced by ImageMatchesFixture(), and TEST_F().

91  {
92  fml::FileMapping fixture_image_mapping(OpenFixture(fixture_file_name));
93 
94  FML_CHECK(fixture_image_mapping.GetSize() != 0u)
95  << "Could not find fixture: " << fixture_file_name;
96 
97  auto encoded_image = SkData::MakeWithoutCopy(
98  fixture_image_mapping.GetMapping(), fixture_image_mapping.GetSize());
99  auto fixture_image =
100  SkImage::MakeFromEncoded(std::move(encoded_image))->makeRasterImage();
101 
102  FML_CHECK(fixture_image) << "Could not create image from fixture: "
103  << fixture_file_name;
104 
105  FML_CHECK(scene_image) << "Invalid scene image.";
106 
107  auto scene_image_subset = scene_image->makeSubset(
108  SkIRect::MakeWH(fixture_image->width(), fixture_image->height()));
109 
110  FML_CHECK(scene_image_subset)
111  << "Could not create image subset for fixture comparison: "
112  << scene_image_subset;
113 
114  const auto images_are_same =
115  RasterImagesAreSame(scene_image_subset, fixture_image);
116 
117  // If the images are not the same, this predicate is going to indicate test
118  // failure. Dump both the actual image and the expectation to disk to the
119  // test author can figure out what went wrong.
120  if (!images_are_same) {
121  const auto fixtures_path = GetFixturesPath();
122 
123  const auto actual_file_name = "actual_" + fixture_file_name;
124  const auto expect_file_name = "expectation_" + fixture_file_name;
125 
126  auto fixtures_fd = OpenFixturesDirectory();
127 
128  FML_CHECK(
129  WriteImageToDisk(fixtures_fd, actual_file_name, scene_image_subset))
130  << "Could not write file to disk: " << actual_file_name;
131 
132  FML_CHECK(WriteImageToDisk(fixtures_fd, expect_file_name, fixture_image))
133  << "Could not write file to disk: " << expect_file_name;
134 
135  FML_LOG(ERROR) << "Image did not match expectation." << std::endl
136  << "Expected:"
137  << fml::paths::JoinPaths({fixtures_path, expect_file_name})
138  << std::endl
139  << "Got:"
140  << fml::paths::JoinPaths({fixtures_path, actual_file_name})
141  << std::endl;
142  }
143  return images_are_same;
144 }
#define FML_LOG(severity)
Definition: logging.h:65
fml::UniqueFD OpenFixturesDirectory()
Opens the fixtures directory for the unit-test harness.
Definition: testing.cc:21
std::string JoinPaths(std::initializer_list< std::string > components)
Definition: paths.cc:14
bool RasterImagesAreSame(sk_sp< SkImage > a, sk_sp< SkImage > b)
fml::UniqueFD OpenFixture(std::string fixture_name)
Opens a fixture of the given file name.
Definition: testing.cc:35
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
#define FML_CHECK(condition)
Definition: logging.h:68
bool WriteImageToDisk(const fml::UniqueFD &directory, const std::string &name, sk_sp< SkImage > image)

◆ ImageMatchesFixture() [2/2]

bool flutter::testing::ImageMatchesFixture ( const std::string &  fixture_file_name,
std::future< sk_sp< SkImage >> &  scene_image 
)

Definition at line 146 of file embedder_unittests_util.cc.

References ImageMatchesFixture().

147  {
148  return ImageMatchesFixture(fixture_file_name, scene_image.get());
149 }
bool ImageMatchesFixture(const std::string &fixture_file_name, std::future< sk_sp< SkImage >> &scene_image)

◆ InvokeAllCallbacks()

static void flutter::testing::InvokeAllCallbacks ( const std::vector< fml::closure > &  callbacks)
static

Definition at line 22 of file embedder_test_compositor.cc.

References callback.

Referenced by flutter::testing::EmbedderTestCompositor::CollectBackingStore(), flutter::testing::EmbedderTestCompositor::CreateBackingStore(), and flutter::testing::EmbedderTestCompositor::Present().

22  {
23  for (const auto& callback : callbacks) {
24  if (callback) {
25  callback();
26  }
27  }
28 }
FlKeyEvent FlKeyResponderAsyncCallback callback

◆ lineTolerance()

BoundsTolerance flutter::testing::lineTolerance ( const BoundsTolerance tolerance,
const SkPaint &  paint,
const SkMatrix &  matrix,
bool  is_horizontal,
bool  is_vertical,
bool  ignores_butt_cap 
)

Definition at line 1437 of file display_list_canvas_unittests.cc.

References flutter::testing::BoundsTolerance::addBoundsPadding(), flutter::testing::CanvasCompareTester::DefaultAdjuster(), flutter::testing::BoundsTolerance::discrete_offset(), and FML_DCHECK.

Referenced by dLineTolerance(), hLineTolerance(), pointsTolerance(), and vLineTolerance().

1442  {
1443  SkScalar adjust = 0.0;
1444  SkScalar half_width = paint.getStrokeWidth() * 0.5f;
1445  if (tolerance.discrete_offset() > 0) {
1446  // When a discrete path effect is added, the bounds calculations must allow
1447  // for miters in any direction, but a horizontal line will not have
1448  // miters in the horizontal direction, similarly for vertical
1449  // lines, and diagonal lines will have miters off at a "45 degree" angle
1450  // that don't expand the bounds much at all.
1451  // Also, the discrete offset will not move any points parallel with
1452  // the line, so provide tolerance for both miters and offset.
1453  adjust = half_width * paint.getStrokeMiter() + tolerance.discrete_offset();
1454  }
1455  if (paint.getStrokeCap() == SkPaint::kButt_Cap && !ignores_butt_cap) {
1456  adjust = std::max(adjust, half_width);
1457  }
1458  if (adjust == 0) {
1459  return CanvasCompareTester::DefaultAdjuster(tolerance, paint, matrix);
1460  }
1461  SkScalar hTolerance;
1462  SkScalar vTolerance;
1463  if (is_horizontal) {
1464  FML_DCHECK(!is_vertical);
1465  hTolerance = adjust;
1466  vTolerance = 0;
1467  } else if (is_vertical) {
1468  hTolerance = 0;
1469  vTolerance = adjust;
1470  } else {
1471  // The perpendicular miters just do not impact the bounds of
1472  // diagonal lines at all as they are aimed in the wrong direction
1473  // to matter. So allow tolerance in both axes.
1474  hTolerance = vTolerance = adjust;
1475  }
1476  BoundsTolerance new_tolerance =
1477  tolerance.addBoundsPadding(hTolerance, vTolerance);
1478  return CanvasCompareTester::DefaultAdjuster(new_tolerance, paint, matrix);
1479 }
#define FML_DCHECK(condition)
Definition: logging.h:86

◆ LoadELFSplitSymbolFromFixturesIfNeccessary()

ELFAOTSymbols flutter::testing::LoadELFSplitSymbolFromFixturesIfNeccessary ( std::string  elf_split_filename)

Attempts to resolve split loading unit AOT symbols from the portable ELF loader. If the dart code does not make use of deferred libraries, then there will be no split .so to load. This only returns valid symbols when the VM is configured for AOT.

Parameters
[in]elf_split_filenameThe split AOT ELF filename from the fixtures generator.
Returns
The loaded ELF symbols.

Definition at line 63 of file elf_loader.cc.

References error, FML_LOG, GetFixturesPath(), fml::IsFile(), flutter::DartVM::IsRunningPrecompiledCode(), fml::paths::JoinPaths(), flutter::testing::ELFAOTSymbols::loaded_elf, flutter::testing::ELFAOTSymbols::vm_isolate_data, flutter::testing::ELFAOTSymbols::vm_isolate_instrs, flutter::testing::ELFAOTSymbols::vm_snapshot_data, and flutter::testing::ELFAOTSymbols::vm_snapshot_instrs.

64  {
65  if (!DartVM::IsRunningPrecompiledCode()) {
66  return {};
67  }
68 
69  const auto elf_path =
70  fml::paths::JoinPaths({GetFixturesPath(), elf_split_filename});
71 
72  if (!fml::IsFile(elf_path)) {
73  // We do not log here, as there is no expectation for a split library to
74  // exist.
75  return {};
76  }
77 
78  ELFAOTSymbols symbols;
79 
80  // Must not be freed.
81  const char* error = nullptr;
82 
83 #if OS_FUCHSIA
84  // TODO(gw280): https://github.com/flutter/flutter/issues/50285
85  // Dart doesn't implement Dart_LoadELF on Fuchsia
86  auto loaded_elf = nullptr;
87 #else
88  auto loaded_elf =
89  Dart_LoadELF(elf_path.c_str(), // file path
90  0, // file offset
91  &error, // error (out)
92  &symbols.vm_snapshot_data, // vm snapshot data (out)
93  &symbols.vm_snapshot_instrs, // vm snapshot instrs (out)
94  &symbols.vm_isolate_data, // vm isolate data (out)
95  &symbols.vm_isolate_instrs // vm isolate instr (out)
96  );
97 #endif
98 
99  if (loaded_elf == nullptr) {
100  FML_LOG(ERROR)
101  << "Could not fetch AOT symbols from loaded ELF. Attempts "
102  "to launch the Dart VM with these AOT symbols will fail. Error: "
103  << error;
104  return {};
105  }
106 
107  symbols.loaded_elf.reset(loaded_elf);
108 
109  return symbols;
110 }
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
Definition: logging.h:65
std::string JoinPaths(std::initializer_list< std::string > components)
Definition: paths.cc:14
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
bool IsFile(const std::string &path)
Definition: file_posix.cc:145

◆ LoadELFSymbolFromFixturesIfNeccessary()

ELFAOTSymbols flutter::testing::LoadELFSymbolFromFixturesIfNeccessary ( std::string  elf_filename)

Attempts to resolve AOT symbols from the portable ELF loader. This location is automatically resolved from the fixtures generator. This only returns valid symbols when the VM is configured for AOT.

Parameters
[in]elf_filenameThe AOT ELF filename from the fixtures generator.
Returns
The loaded ELF symbols.

Definition at line 15 of file elf_loader.cc.

References error, FML_LOG, GetFixturesPath(), fml::IsFile(), flutter::DartVM::IsRunningPrecompiledCode(), fml::paths::JoinPaths(), flutter::testing::ELFAOTSymbols::loaded_elf, flutter::testing::ELFAOTSymbols::vm_isolate_data, flutter::testing::ELFAOTSymbols::vm_isolate_instrs, flutter::testing::ELFAOTSymbols::vm_snapshot_data, and flutter::testing::ELFAOTSymbols::vm_snapshot_instrs.

Referenced by flutter::StartupAndShutdownShell().

15  {
16  if (!DartVM::IsRunningPrecompiledCode()) {
17  return {};
18  }
19 
20  const auto elf_path =
21  fml::paths::JoinPaths({GetFixturesPath(), elf_filename});
22 
23  if (!fml::IsFile(elf_path)) {
24  FML_LOG(ERROR) << "App AOT file does not exist for this fixture. Attempts "
25  "to launch the Dart VM with these AOT symbols will fail.";
26  return {};
27  }
28 
29  ELFAOTSymbols symbols;
30 
31  // Must not be freed.
32  const char* error = nullptr;
33 
34 #if OS_FUCHSIA
35  // TODO(gw280): https://github.com/flutter/flutter/issues/50285
36  // Dart doesn't implement Dart_LoadELF on Fuchsia
37  auto loaded_elf = nullptr;
38 #else
39  auto loaded_elf =
40  Dart_LoadELF(elf_path.c_str(), // file path
41  0, // file offset
42  &error, // error (out)
43  &symbols.vm_snapshot_data, // vm snapshot data (out)
44  &symbols.vm_snapshot_instrs, // vm snapshot instrs (out)
45  &symbols.vm_isolate_data, // vm isolate data (out)
46  &symbols.vm_isolate_instrs // vm isolate instr (out)
47  );
48 #endif
49 
50  if (loaded_elf == nullptr) {
51  FML_LOG(ERROR)
52  << "Could not fetch AOT symbols from loaded ELF. Attempts "
53  "to launch the Dart VM with these AOT symbols will fail. Error: "
54  << error;
55  return {};
56  }
57 
58  symbols.loaded_elf.reset(loaded_elf);
59 
60  return symbols;
61 }
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
Definition: logging.h:65
std::string JoinPaths(std::initializer_list< std::string > components)
Definition: paths.cc:14
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
bool IsFile(const std::string &path)
Definition: file_posix.cc:145

◆ LoadValidImageFixture()

static sk_sp<SkData> flutter::testing::LoadValidImageFixture ( )
static

Definition at line 14 of file image_generator_registry_unittests.cc.

References flutter::data, and OpenFixtureAsMapping().

Referenced by TEST_F().

14  {
15  auto fixture_mapping = OpenFixtureAsMapping("DashInNooglerHat.jpg");
16 
17  // Remap to sk_sp<SkData>.
18  SkData::ReleaseProc on_release = [](const void* ptr, void* context) -> void {
19  delete reinterpret_cast<fml::FileMapping*>(context);
20  };
21  auto data = SkData::MakeWithProc(fixture_mapping->GetMapping(),
22  fixture_mapping->GetSize(), on_release,
23  fixture_mapping.get());
24 
25  if (data) {
26  fixture_mapping.release();
27  }
28 
29  return data;
30 }
std::unique_ptr< fml::Mapping > OpenFixtureAsMapping(std::string fixture_name)
Opens a fixture of the given file name and returns a mapping to its contents.
Definition: testing.cc:57
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ LogSkData()

static void flutter::testing::LogSkData ( sk_sp< SkData >  data,
const char *  title 
)
static

Definition at line 1795 of file shell_unittests.cc.

References FML_LOG.

Referenced by TEST_F().

1795  {
1796  FML_LOG(ERROR) << "---------- " << title;
1797  std::ostringstream ostr;
1798  for (size_t i = 0; i < data->size();) {
1799  ostr << std::hex << std::setfill('0') << std::setw(2)
1800  << static_cast<int>(data->bytes()[i]) << " ";
1801  i++;
1802  if (i % 16 == 0 || i == data->size()) {
1803  FML_LOG(ERROR) << ostr.str();
1804  ostr.str("");
1805  ostr.clear();
1806  }
1807  }
1808 }
#define FML_LOG(severity)
Definition: logging.h:65
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ MakeSizedPicture()

static sk_sp<SkPicture> flutter::testing::MakeSizedPicture ( int  width,
int  height 
)
static

Definition at line 2191 of file shell_unittests.cc.

Referenced by TEST_F().

2191  {
2192  SkPictureRecorder recorder;
2193  SkCanvas* recording_canvas =
2194  recorder.beginRecording(SkRect::MakeXYWH(0, 0, width, height));
2195  recording_canvas->drawRect(SkRect::MakeXYWH(0, 0, width, height),
2196  SkPaint(SkColor4f::FromColor(SK_ColorRED)));
2197  return recorder.finishRecordingAsPicture();
2198 }
int32_t width
int32_t height

◆ MakeTestDisplayList()

static sk_sp<DisplayList> flutter::testing::MakeTestDisplayList ( int  w,
int  h,
SkColor  color 
)
static

Definition at line 200 of file display_list_unittests.cc.

References flutter::DisplayListBuilder::Build(), flutter::DisplayListBuilder::drawRect(), and flutter::DisplayListBuilder::setColor().

200  {
201  DisplayListBuilder builder;
202  builder.setColor(color);
203  builder.drawRect(SkRect::MakeWH(w, h));
204  return builder.Build();
205 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder h
Definition: switches.h:57

◆ MakeTestImage()

static sk_sp<SkImage> flutter::testing::MakeTestImage ( int  w,
int  h,
int  checker_size 
)
static

Definition at line 133 of file display_list_unittests.cc.

References flutter::h.

133  {
134  sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(w, h);
135  SkCanvas* canvas = surface->getCanvas();
136  SkPaint p0, p1;
137  p0.setStyle(SkPaint::kFill_Style);
138  p0.setColor(SK_ColorGREEN);
139  p1.setStyle(SkPaint::kFill_Style);
140  p1.setColor(SK_ColorBLUE);
141  p1.setAlpha(128);
142  for (int y = 0; y < w; y += checker_size) {
143  for (int x = 0; x < h; x += checker_size) {
144  SkPaint& cellp = ((x + y) & 1) == 0 ? p0 : p1;
145  canvas->drawRect(SkRect::MakeXYWH(x, y, checker_size, checker_size),
146  cellp);
147  }
148  }
149  return surface->makeImageSnapshot();
150 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder h
Definition: switches.h:57

◆ MakeTestPicture()

static sk_sp<SkPicture> flutter::testing::MakeTestPicture ( int  w,
int  h,
SkColor  color 
)
static

Definition at line 188 of file display_list_unittests.cc.

188  {
189  SkPictureRecorder recorder;
190  SkCanvas* cv = recorder.beginRecording(TestBounds);
191  SkPaint paint;
192  paint.setColor(color);
193  paint.setStyle(SkPaint::kFill_Style);
194  cv->drawRect(SkRect::MakeWH(w, h), paint);
195  return recorder.finishRecordingAsPicture();
196 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder h
Definition: switches.h:57

◆ makeTestPicture()

sk_sp<SkPicture> flutter::testing::makeTestPicture ( )

Definition at line 2187 of file display_list_canvas_unittests.cc.

References colors, RenderBottom, RenderCenterX, RenderCenterY, RenderLeft, RenderRight, and RenderTop.

Referenced by TEST().

2187  {
2188  SkPictureRecorder recorder;
2189  SkCanvas* cv = recorder.beginRecording(RenderBounds);
2190  SkPaint p;
2191  p.setStyle(SkPaint::kFill_Style);
2192  SkScalar x_coords[] = {
2193  RenderLeft,
2194  RenderCenterX,
2195  RenderRight,
2196  };
2197  SkScalar y_coords[] = {
2198  RenderTop,
2199  RenderCenterY,
2200  RenderBottom,
2201  };
2202  SkColor colors[][2] = {
2203  {
2204  SK_ColorRED,
2205  SK_ColorBLUE,
2206  },
2207  {
2208  SK_ColorGREEN,
2209  SK_ColorYELLOW,
2210  },
2211  };
2212  for (int j = 0; j < 2; j++) {
2213  for (int i = 0; i < 2; i++) {
2214  SkRect rect = {
2215  x_coords[i],
2216  y_coords[j],
2217  x_coords[i + 1],
2218  y_coords[j + 1],
2219  };
2220  p.setColor(colors[i][j]);
2221  cv->drawOval(rect, p);
2222  }
2223  }
2224  return recorder.finishRecordingAsPicture();
2225 }
constexpr SkColor colors[]

◆ MakeTextBlob()

static sk_sp<SkTextBlob> flutter::testing::MakeTextBlob ( std::string  string)
static

Definition at line 211 of file display_list_unittests.cc.

References fml::size().

211  {
212  return SkTextBlob::MakeFromText(string.c_str(), string.size(), SkFont(),
213  SkTextEncoding::kUTF8);
214 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

◆ MemsetPatternSetOrCheck() [1/2]

bool flutter::testing::MemsetPatternSetOrCheck ( uint8_t *  buffer,
size_t  size,
MemsetPatternOp  op 
)

Depending on the operation, either scribbles a known pattern into the buffer or checks if that pattern is present in an existing buffer. This is a portable variant of the memset_pattern class of methods that also happen to do assert that the same pattern exists.

Parameters
bufferThe buffer
[in]sizeThe size
[in]opThe operation
Returns
If the result of the operation was a success.

Definition at line 61 of file testing.cc.

References flutter::buffer, kMemsetPatternOpCheckBuffer, and kMemsetPatternOpSetBuffer.

Referenced by MemsetPatternSetOrCheck(), and TEST_F().

61  {
62  if (buffer == nullptr) {
63  return false;
64  }
65 
66  auto pattern = reinterpret_cast<const uint8_t*>("dErP");
67  constexpr auto pattern_length = 4;
68 
69  uint8_t* start = buffer;
70  uint8_t* p = buffer;
71 
72  while ((start + size) - p >= pattern_length) {
73  switch (op) {
74  case MemsetPatternOp::kMemsetPatternOpSetBuffer:
75  memmove(p, pattern, pattern_length);
76  break;
77  case MemsetPatternOp::kMemsetPatternOpCheckBuffer:
78  if (memcmp(pattern, p, pattern_length) != 0) {
79  return false;
80  }
81  break;
82  };
83  p += pattern_length;
84  }
85 
86  if ((start + size) - p != 0) {
87  switch (op) {
88  case MemsetPatternOp::kMemsetPatternOpSetBuffer:
89  memmove(p, pattern, (start + size) - p);
90  break;
91  case MemsetPatternOp::kMemsetPatternOpCheckBuffer:
92  if (memcmp(pattern, p, (start + size) - p) != 0) {
93  return false;
94  }
95  break;
96  }
97  }
98 
99  return true;
100 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
static const uint8_t buffer[]

◆ MemsetPatternSetOrCheck() [2/2]

bool flutter::testing::MemsetPatternSetOrCheck ( std::vector< uint8_t > &  buffer,
MemsetPatternOp  op 
)

Definition at line 102 of file testing.cc.

References MemsetPatternSetOrCheck().

102  {
103  return MemsetPatternSetOrCheck(buffer.data(), buffer.size(), op);
104 }
bool MemsetPatternSetOrCheck(std::vector< uint8_t > &buffer, MemsetPatternOp op)
Definition: testing.cc:102
static const uint8_t buffer[]

◆ MockEmbedderApiForKeyboard()

void flutter::testing::MockEmbedderApiForKeyboard ( EngineModifier modifier,
MockKeyEventChannelHandler  channel_handler,
MockKeyEventEmbedderHandler  embedder_handler 
)

Definition at line 97 of file test_keyboard.cc.

References args, callback, flutter::EngineModifier::embedder_api(), engine, event, kSuccess, FlutterEngineProcTable::PlatformMessageCreateResponseHandle, FlutterEngineProcTable::PlatformMessageReleaseResponseHandle, result, FlutterEngineProcTable::Run, FlutterEngineProcTable::SendKeyEvent, FlutterEngineProcTable::SendPlatformMessage, FlutterEngineProcTable::SendWindowMetricsEvent, FlutterEngineProcTable::Shutdown, stored_channel_handler, stored_embedder_handler, FlutterEngineProcTable::UpdateLocales, and user_data.

99  {
100  stored_channel_handler = channel_handler;
101  stored_embedder_handler = embedder_handler;
102  // This mock handles channel messages.
103  modifier.embedder_api().SendPlatformMessage =
105  const FlutterPlatformMessage* message) {
106  if (std::string(message->channel) == std::string("flutter/settings")) {
107  return kSuccess;
108  }
109  if (std::string(message->channel) == std::string("flutter/keyevent")) {
111  auto response = _keyHandlingResponse(result);
112  const TestResponseHandle* response_handle =
113  reinterpret_cast<const TestResponseHandle*>(
114  message->response_handle);
115  if (response_handle->callback != nullptr) {
116  response_handle->callback(response->data(), response->size(),
117  response_handle->user_data);
118  }
119  return kSuccess;
120  }
121  return kSuccess;
122  };
123 
124  // This mock handles key events sent through the embedder API,
125  // and records it in `key_calls`.
126  modifier.embedder_api().SendKeyEvent =
129  bool result = stored_embedder_handler(event);
130  if (callback != nullptr) {
131  callback(result, user_data);
132  }
133  return kSuccess;
134  };
135 
136  // The following mocks enable channel mocking.
137  modifier.embedder_api().PlatformMessageCreateResponseHandle =
138  [](auto engine, auto data_callback, auto user_data, auto response_out) {
139  TestResponseHandle* response_handle = new TestResponseHandle();
140  response_handle->user_data = user_data;
141  response_handle->callback = data_callback;
142  *response_out = reinterpret_cast<FlutterPlatformMessageResponseHandle*>(
143  response_handle);
144  return kSuccess;
145  };
146 
147  modifier.embedder_api().PlatformMessageReleaseResponseHandle =
150  const TestResponseHandle* response_handle =
151  reinterpret_cast<const TestResponseHandle*>(response);
152  delete response_handle;
153  return kSuccess;
154  };
155 
156  // The following mocks allows RunWithEntrypoint to be run, which creates a
157  // non-empty FlutterEngine and enables SendKeyEvent.
158 
159  modifier.embedder_api().Run =
160  [](size_t version, const FlutterRendererConfig* config,
161  const FlutterProjectArgs* args, void* user_data,
162  FLUTTER_API_SYMBOL(FlutterEngine) * engine_out) {
163  *engine_out = reinterpret_cast<FLUTTER_API_SYMBOL(FlutterEngine)>(1);
164 
165  return kSuccess;
166  };
167  modifier.embedder_api().UpdateLocales =
168  [](auto engine, const FlutterLocale** locales, size_t locales_count) {
169  return kSuccess;
170  };
171  modifier.embedder_api().SendWindowMetricsEvent =
172  [](auto engine, const FlutterWindowMetricsEvent* event) {
173  return kSuccess;
174  };
175  modifier.embedder_api().Shutdown = [](auto engine) { return kSuccess; };
176 }
G_BEGIN_DECLS FlValue * args
struct _FlutterEngine * FLUTTER_API_SYMBOL(FlutterEngine)
Definition: embedder.h:228
GAsyncResult * result
FlKeyEvent * event
gchar gchar gchar gchar ** modifier
Definition: fl_engine.cc:74
static MockKeyEventEmbedderHandler stored_embedder_handler
void * user_data
FlutterDesktopBinaryReply callback
void(* FlutterKeyEventCallback)(bool, void *)
Definition: embedder.h:748
static MockKeyEventChannelHandler stored_channel_handler

◆ NormalizeImage()

static sk_sp<SkData> flutter::testing::NormalizeImage ( sk_sp< SkImage >  image)
static

Definition at line 34 of file embedder_unittests_util.cc.

References flutter::data, FML_CHECK, and fml::size().

Referenced by RasterImagesAreSame().

34  {
35  // To avoid clipping, convert to a very wide gamut, and a high bit depth.
36  sk_sp<SkColorSpace> norm_colorspace = SkColorSpace::MakeRGB(
37  SkNamedTransferFn::kRec2020, SkNamedGamut::kRec2020);
38  SkImageInfo norm_image_info =
39  SkImageInfo::Make(image->width(), image->height(),
40  SkColorType::kR16G16B16A16_unorm_SkColorType,
41  SkAlphaType::kUnpremul_SkAlphaType, norm_colorspace);
42  size_t row_bytes = norm_image_info.minRowBytes();
43  size_t size = norm_image_info.computeByteSize(row_bytes);
44  sk_sp<SkData> data = SkData::MakeUninitialized(size);
45  if (!data) {
46  FML_CHECK(false) << "Unable to allocate data.";
47  }
48 
49  bool success = image->readPixels(norm_image_info, data->writable_data(),
50  row_bytes, 0, 0);
51  if (!success) {
52  FML_CHECK(false) << "Unable to read pixels.";
53  }
54 
55  return data;
56 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41
#define FML_CHECK(condition)
Definition: logging.h:68

◆ NumberNear()

bool flutter::testing::NumberNear ( double  a,
double  b 
)
inline

Definition at line 13 of file assertions.h.

Referenced by operator==().

13  {
14  static const double epsilon = 1e-3;
15  return (a > (b - epsilon)) && (a < (b + epsilon));
16 }

◆ OpenFixture()

fml::UniqueFD flutter::testing::OpenFixture ( std::string  fixture_name)

Opens a fixture of the given file name.

Parameters
[in]fixture_nameThe fixture name
Returns
The file descriptor of the given fixture. An invalid file descriptor is returned in case the fixture is not found.

Definition at line 35 of file testing.cc.

References FML_LOG, GetFixturesPath(), fml::kRead, fml::OpenFile(), and OpenFixturesDirectory().

Referenced by ImageMatchesFixture(), and OpenFixtureAsMapping().

35  {
36  if (fixture_name.size() == 0) {
37  FML_LOG(ERROR) << "Invalid fixture name.";
38  return {};
39  }
40 
41  auto fixtures_directory = OpenFixturesDirectory();
42 
43  auto fixture_fd = fml::OpenFile(fixtures_directory, // base directory
44  fixture_name.c_str(), // path
45  false, // create
46  fml::FilePermission::kRead // permission
47  );
48  if (!fixture_fd.is_valid()) {
49  FML_LOG(ERROR) << "Could not open fixture for path: " << GetFixturesPath()
50  << "/" << fixture_name << ".";
51  return {};
52  }
53 
54  return fixture_fd;
55 }
#define FML_LOG(severity)
Definition: logging.h:65
fml::UniqueFD OpenFixturesDirectory()
Opens the fixtures directory for the unit-test harness.
Definition: testing.cc:21
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
fml::UniqueFD OpenFile(const char *path, bool create_if_necessary, FilePermission permission)
This can open a directory on POSIX, but not on Windows.
Definition: file_posix.cc:65

◆ OpenFixtureAsMapping()

std::unique_ptr< fml::Mapping > flutter::testing::OpenFixtureAsMapping ( std::string  fixture_name)

Opens a fixture of the given file name and returns a mapping to its contents.

Parameters
[in]fixture_nameThe fixture name
Returns
A mapping to the contents of fixture or null if the fixture does not exist or its contents cannot be mapped in.

Definition at line 57 of file testing.cc.

References fml::FileMapping::CreateReadOnly(), and OpenFixture().

Referenced by LoadValidImageFixture(), and TEST_F().

57  {
58  return fml::FileMapping::CreateReadOnly(OpenFixture(fixture_name));
59 }
fml::UniqueFD OpenFixture(std::string fixture_name)
Opens a fixture of the given file name.
Definition: testing.cc:35
static std::unique_ptr< FileMapping > CreateReadOnly(const std::string &path)
Definition: mapping.cc:18

◆ OpenFixtureAsSkData()

static sk_sp<SkData> flutter::testing::OpenFixtureAsSkData ( const char *  name)
static

Definition at line 95 of file image_decoder_unittests.cc.

References fml::FileMapping::CreateReadOnly(), flutter::data, GetFixturesPath(), fml::kRead, and fml::OpenDirectory().

Referenced by TEST(), and TEST_F().

95  {
96  auto fixtures_directory =
98  if (!fixtures_directory.is_valid()) {
99  return nullptr;
100  }
101 
102  auto fixture_mapping =
103  fml::FileMapping::CreateReadOnly(fixtures_directory, name);
104 
105  if (!fixture_mapping) {
106  return nullptr;
107  }
108 
109  SkData::ReleaseProc on_release = [](const void* ptr, void* context) -> void {
110  delete reinterpret_cast<fml::FileMapping*>(context);
111  };
112 
113  auto data = SkData::MakeWithProc(fixture_mapping->GetMapping(),
114  fixture_mapping->GetSize(), on_release,
115  fixture_mapping.get());
116 
117  if (!data) {
118  return nullptr;
119  }
120  // The data is now owned by Skia.
121  fixture_mapping.release();
122  return data;
123 }
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
fml::UniqueFD OpenDirectory(const char *path, bool create_if_necessary, FilePermission permission)
Definition: file_posix.cc:96
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
static std::unique_ptr< FileMapping > CreateReadOnly(const std::string &path)
Definition: mapping.cc:18

◆ OpenFixturesDirectory()

fml::UniqueFD flutter::testing::OpenFixturesDirectory ( )

Opens the fixtures directory for the unit-test harness.

Returns
The file descriptor of the fixtures directory.

Definition at line 21 of file testing.cc.

References FML_LOG, GetFixturesPath(), fml::kRead, and fml::OpenDirectory().

Referenced by ImageMatchesFixture(), and OpenFixture().

21  {
22  auto fixtures_directory =
24  false, // create
25  fml::FilePermission::kRead // permission
26  );
27 
28  if (!fixtures_directory.is_valid()) {
29  FML_LOG(ERROR) << "Could not open fixtures directory.";
30  return {};
31  }
32  return fixtures_directory;
33 }
#define FML_LOG(severity)
Definition: logging.h:65
fml::UniqueFD OpenDirectory(const char *path, bool create_if_necessary, FilePermission permission)
Definition: file_posix.cc:96
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...

◆ operator<<() [1/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkClipOp &  o 
)

Definition at line 10 of file assertions_skia.cc.

10  {
11  switch (o) {
12  case SkClipOp::kDifference:
13  os << "ClipOpDifference";
14  break;
15  case SkClipOp::kIntersect:
16  os << "ClipOpIntersect";
17  break;
18  default:
19  os << "ClipOpUnknown" << static_cast<int>(o);
20  break;
21  }
22  return os;
23 }

◆ operator<<() [2/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkMatrix &  m 
)

Definition at line 25 of file assertions_skia.cc.

25  {
26  os << std::endl;
27  os << "Scale X: " << m[SkMatrix::kMScaleX] << ", ";
28  os << "Skew X: " << m[SkMatrix::kMSkewX] << ", ";
29  os << "Trans X: " << m[SkMatrix::kMTransX] << std::endl;
30  os << "Skew Y: " << m[SkMatrix::kMSkewY] << ", ";
31  os << "Scale Y: " << m[SkMatrix::kMScaleY] << ", ";
32  os << "Trans Y: " << m[SkMatrix::kMTransY] << std::endl;
33  os << "Persp X: " << m[SkMatrix::kMPersp0] << ", ";
34  os << "Persp Y: " << m[SkMatrix::kMPersp1] << ", ";
35  os << "Persp Z: " << m[SkMatrix::kMPersp2];
36  os << std::endl;
37  return os;
38 }

◆ operator<<() [3/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockTexture::PaintCall data 
)

Definition at line 28 of file mock_texture.cc.

References flutter::testing::MockTexture::PaintCall::bounds, flutter::testing::MockTexture::PaintCall::canvas, flutter::testing::MockTexture::PaintCall::context, flutter::testing::MockTexture::PaintCall::freeze, and flutter::testing::MockTexture::PaintCall::sampling.

Referenced by flutter::testing::MockCanvas::didRestore(), and flutter::testing::MockTexture::unregistered().

28  {
29  return os << &data.canvas << " " << data.bounds << " " << data.context << " "
30  << data.freeze << " " << data.sampling;
31 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [4/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkM44 &  m 
)

Definition at line 40 of file assertions_skia.cc.

40  {
41  os << m.rc(0, 0) << ", " << m.rc(0, 1) << ", " << m.rc(0, 2) << ", "
42  << m.rc(0, 3) << std::endl;
43  os << m.rc(1, 0) << ", " << m.rc(1, 1) << ", " << m.rc(1, 2) << ", "
44  << m.rc(1, 3) << std::endl;
45  os << m.rc(2, 0) << ", " << m.rc(2, 1) << ", " << m.rc(2, 2) << ", "
46  << m.rc(2, 3) << std::endl;
47  os << m.rc(3, 0) << ", " << m.rc(3, 1) << ", " << m.rc(3, 2) << ", "
48  << m.rc(3, 3);
49  return os;
50 }

◆ operator<<() [5/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkVector3 &  v 
)

Definition at line 52 of file assertions_skia.cc.

52  {
53  return os << v.x() << ", " << v.y() << ", " << v.z();
54 }

◆ operator<<() [6/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkRect &  r 
)

Definition at line 56 of file assertions_skia.cc.

56  {
57  return os << "LTRB: " << r.fLeft << ", " << r.fTop << ", " << r.fRight << ", "
58  << r.fBottom;
59 }

◆ operator<<() [7/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkRRect &  r 
)

Definition at line 61 of file assertions_skia.cc.

61  {
62  return os << "LTRB: " << r.rect().fLeft << ", " << r.rect().fTop << ", "
63  << r.rect().fRight << ", " << r.rect().fBottom;
64 }

◆ operator<<() [8/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkPath &  r 
)

Definition at line 66 of file assertions_skia.cc.

66  {
67  return os << "Valid: " << r.isValid()
68  << ", FillType: " << static_cast<int>(r.getFillType())
69  << ", Bounds: " << r.getBounds();
70 }

◆ operator<<() [9/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkPoint &  r 
)

Definition at line 72 of file assertions_skia.cc.

72  {
73  return os << "XY: " << r.fX << ", " << r.fY;
74 }

◆ operator<<() [10/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkISize &  size 
)

Definition at line 76 of file assertions_skia.cc.

76  {
77  return os << size.width() << ", " << size.height();
78 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

◆ operator<<() [11/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkColor4f &  r 
)

Definition at line 80 of file assertions_skia.cc.

80  {
81  return os << r.fR << ", " << r.fG << ", " << r.fB << ", " << r.fA;
82 }

◆ operator<<() [12/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkPaint &  r 
)

Definition at line 84 of file assertions_skia.cc.

84  {
85  return os << "Color: " << r.getColor4f() << ", Style: " << r.getStyle()
86  << ", AA: " << r.isAntiAlias() << ", Shader: " << r.getShader();
87 }

◆ operator<<() [13/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const SkSamplingOptions &  s 
)

Definition at line 89 of file assertions_skia.cc.

89  {
90  if (s.useCubic) {
91  return os << "CubicResampler: " << s.cubic.B << ", " << s.cubic.C;
92  } else {
93  return os << "Filter: " << static_cast<int>(s.filter)
94  << ", Mipmap: " << static_cast<int>(s.mipmap);
95  }
96 }

◆ operator<<() [14/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::SaveData data 
)

Definition at line 284 of file mock_canvas.cc.

References flutter::testing::MockCanvas::SaveData::save_to_layer.

284  {
285  return os << data.save_to_layer;
286 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [15/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::SaveLayerData data 
)

Definition at line 295 of file mock_canvas.cc.

References flutter::testing::MockCanvas::SaveLayerData::backdrop_filter, flutter::testing::MockCanvas::SaveLayerData::restore_paint, flutter::testing::MockCanvas::SaveLayerData::save_bounds, and flutter::testing::MockCanvas::SaveLayerData::save_to_layer.

296  {
297  return os << data.save_bounds << " " << data.restore_paint << " "
298  << data.backdrop_filter << " " << data.save_to_layer;
299 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [16/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::RestoreData data 
)

Definition at line 306 of file mock_canvas.cc.

References flutter::testing::MockCanvas::RestoreData::restore_to_layer.

307  {
308  return os << data.restore_to_layer;
309 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [17/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::ConcatMatrixData data 
)

Definition at line 316 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ConcatMatrixData::matrix.

317  {
318  return os << data.matrix;
319 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [18/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::SetMatrixData data 
)

Definition at line 326 of file mock_canvas.cc.

References flutter::testing::MockCanvas::SetMatrixData::matrix.

327  {
328  return os << data.matrix;
329 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [19/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawRectData data 
)

Definition at line 336 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawRectData::paint, and flutter::testing::MockCanvas::DrawRectData::rect.

337  {
338  return os << data.rect << " " << data.paint;
339 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [20/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawPathData data 
)

Definition at line 346 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawPathData::paint, and flutter::testing::MockCanvas::DrawPathData::path.

347  {
348  return os << data.path << " " << data.paint;
349 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [21/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawTextData data 
)

Definition at line 357 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawTextData::offset, flutter::testing::MockCanvas::DrawTextData::paint, and flutter::testing::MockCanvas::DrawTextData::serialized_text.

358  {
359  return os << data.serialized_text << " " << data.paint << " " << data.offset;
360 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [22/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawPictureData data 
)

Definition at line 368 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawPictureData::matrix, flutter::testing::MockCanvas::DrawPictureData::paint, and flutter::testing::MockCanvas::DrawPictureData::serialized_picture.

369  {
370  return os << data.serialized_picture << " " << data.paint << " "
371  << data.matrix;
372 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [23/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawShadowData data 
)

Definition at line 379 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawShadowData::path.

380  {
381  return os << data.path;
382 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [24/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::ClipRectData data 
)

Definition at line 389 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ClipRectData::clip_op, flutter::testing::MockCanvas::ClipRectData::rect, and flutter::testing::MockCanvas::ClipRectData::style.

390  {
391  return os << data.rect << " " << data.clip_op << " " << data.style;
392 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [25/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::ClipRRectData data 
)

Definition at line 399 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ClipRRectData::clip_op, flutter::testing::MockCanvas::ClipRRectData::rrect, and flutter::testing::MockCanvas::ClipRRectData::style.

400  {
401  return os << data.rrect << " " << data.clip_op << " " << data.style;
402 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [26/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::ClipPathData data 
)

Definition at line 409 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ClipPathData::clip_op, flutter::testing::MockCanvas::ClipPathData::path, and flutter::testing::MockCanvas::ClipPathData::style.

410  {
411  return os << data.path << " " << data.clip_op << " " << data.style;
412 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [27/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawCallData data 
)

Definition at line 414 of file mock_canvas.cc.

References flutter::data.

415  {
416  std::visit([&os](auto& d) { os << d; }, data);
417  return os;
418 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator<<() [28/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawCall draw 
)

Definition at line 424 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawCall::data, and flutter::testing::MockCanvas::DrawCall::layer.

424  {
425  return os << "[Layer: " << draw.layer << ", Data: " << draw.data << "]";
426 }

◆ operator<<() [29/29]

std::ostream & flutter::testing::operator<< ( std::ostream &  os,
const MockCanvas::DrawPaint data 
)

Definition at line 433 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawPaint::paint.

433  {
434  return os << data.paint;
435 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41

◆ operator==() [1/16]

◆ operator==() [2/16]

bool flutter::testing::operator== ( const MockCanvas::SaveData a,
const MockCanvas::SaveData b 
)

Definition at line 280 of file mock_canvas.cc.

References flutter::testing::MockCanvas::SaveData::save_to_layer.

280  {
281  return a.save_to_layer == b.save_to_layer;
282 }

◆ operator==() [3/16]

bool flutter::testing::operator== ( const MockCanvas::SaveLayerData a,
const MockCanvas::SaveLayerData b 
)

Definition at line 288 of file mock_canvas.cc.

References flutter::testing::MockCanvas::SaveLayerData::backdrop_filter, flutter::testing::MockCanvas::SaveLayerData::restore_paint, flutter::testing::MockCanvas::SaveLayerData::save_bounds, and flutter::testing::MockCanvas::SaveLayerData::save_to_layer.

289  {
290  return a.save_bounds == b.save_bounds && a.restore_paint == b.restore_paint &&
291  a.backdrop_filter == b.backdrop_filter &&
292  a.save_to_layer == b.save_to_layer;
293 }

◆ operator==() [4/16]

bool flutter::testing::operator== ( const MockCanvas::RestoreData a,
const MockCanvas::RestoreData b 
)

Definition at line 301 of file mock_canvas.cc.

References flutter::testing::MockCanvas::RestoreData::restore_to_layer.

302  {
303  return a.restore_to_layer == b.restore_to_layer;
304 }

◆ operator==() [5/16]

bool flutter::testing::operator== ( const MockCanvas::ConcatMatrixData a,
const MockCanvas::ConcatMatrixData b 
)

Definition at line 311 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ConcatMatrixData::matrix.

312  {
313  return a.matrix == b.matrix;
314 }

◆ operator==() [6/16]

bool flutter::testing::operator== ( const MockCanvas::SetMatrixData a,
const MockCanvas::SetMatrixData b 
)

Definition at line 321 of file mock_canvas.cc.

References flutter::testing::MockCanvas::SetMatrixData::matrix.

322  {
323  return a.matrix == b.matrix;
324 }

◆ operator==() [7/16]

bool flutter::testing::operator== ( const MockCanvas::DrawRectData a,
const MockCanvas::DrawRectData b 
)

Definition at line 331 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawRectData::paint, and flutter::testing::MockCanvas::DrawRectData::rect.

332  {
333  return a.rect == b.rect && a.paint == b.paint;
334 }

◆ operator==() [8/16]

bool flutter::testing::operator== ( const MockCanvas::DrawPathData a,
const MockCanvas::DrawPathData b 
)

Definition at line 341 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawPathData::paint, and flutter::testing::MockCanvas::DrawPathData::path.

342  {
343  return a.path == b.path && a.paint == b.paint;
344 }

◆ operator==() [9/16]

bool flutter::testing::operator== ( const MockCanvas::DrawTextData a,
const MockCanvas::DrawTextData b 
)

Definition at line 351 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawTextData::offset, flutter::testing::MockCanvas::DrawTextData::paint, and flutter::testing::MockCanvas::DrawTextData::serialized_text.

352  {
353  return a.serialized_text->equals(b.serialized_text.get()) &&
354  a.paint == b.paint && a.offset == b.offset;
355 }

◆ operator==() [10/16]

bool flutter::testing::operator== ( const MockCanvas::DrawPictureData a,
const MockCanvas::DrawPictureData b 
)

Definition at line 362 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawPictureData::matrix, flutter::testing::MockCanvas::DrawPictureData::paint, and flutter::testing::MockCanvas::DrawPictureData::serialized_picture.

363  {
364  return a.serialized_picture->equals(b.serialized_picture.get()) &&
365  a.paint == b.paint && a.matrix == b.matrix;
366 }

◆ operator==() [11/16]

bool flutter::testing::operator== ( const MockCanvas::DrawShadowData a,
const MockCanvas::DrawShadowData b 
)

Definition at line 374 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawShadowData::path.

375  {
376  return a.path == b.path;
377 }

◆ operator==() [12/16]

bool flutter::testing::operator== ( const MockCanvas::ClipRectData a,
const MockCanvas::ClipRectData b 
)

Definition at line 384 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ClipRectData::clip_op, flutter::testing::MockCanvas::ClipRectData::rect, and flutter::testing::MockCanvas::ClipRectData::style.

385  {
386  return a.rect == b.rect && a.clip_op == b.clip_op && a.style == b.style;
387 }

◆ operator==() [13/16]

bool flutter::testing::operator== ( const MockCanvas::ClipRRectData a,
const MockCanvas::ClipRRectData b 
)

Definition at line 394 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ClipRRectData::clip_op, flutter::testing::MockCanvas::ClipRRectData::rrect, and flutter::testing::MockCanvas::ClipRRectData::style.

395  {
396  return a.rrect == b.rrect && a.clip_op == b.clip_op && a.style == b.style;
397 }

◆ operator==() [14/16]

bool flutter::testing::operator== ( const MockCanvas::ClipPathData a,
const MockCanvas::ClipPathData b 
)

Definition at line 404 of file mock_canvas.cc.

References flutter::testing::MockCanvas::ClipPathData::clip_op, flutter::testing::MockCanvas::ClipPathData::path, and flutter::testing::MockCanvas::ClipPathData::style.

405  {
406  return a.path == b.path && a.clip_op == b.clip_op && a.style == b.style;
407 }

◆ operator==() [15/16]

bool flutter::testing::operator== ( const MockCanvas::DrawCall a,
const MockCanvas::DrawCall b 
)

Definition at line 420 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawCall::data, and flutter::testing::MockCanvas::DrawCall::layer.

420  {
421  return a.layer == b.layer && a.data == b.data;
422 }

◆ operator==() [16/16]

bool flutter::testing::operator== ( const MockCanvas::DrawPaint a,
const MockCanvas::DrawPaint b 
)

Definition at line 428 of file mock_canvas.cc.

References flutter::testing::MockCanvas::DrawPaint::paint.

429  {
430  return a.paint == b.paint;
431 }

◆ poi