Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros | Functions
embedder_unittests.cc File Reference
#include <string>
#include <utility>
#include <vector>
#include "embedder.h"
#include "embedder_engine.h"
#include "flutter/common/constants.h"
#include "flutter/flow/raster_cache.h"
#include "flutter/fml/file.h"
#include "flutter/fml/make_copyable.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/message_loop.h"
#include "flutter/fml/paths.h"
#include "flutter/fml/synchronization/count_down_latch.h"
#include "flutter/fml/synchronization/waitable_event.h"
#include "flutter/fml/task_runner.h"
#include "flutter/fml/thread.h"
#include "flutter/fml/time/time_delta.h"
#include "flutter/fml/time/time_point.h"
#include "flutter/runtime/dart_vm.h"
#include "flutter/shell/platform/embedder/tests/embedder_assertions.h"
#include "flutter/shell/platform/embedder/tests/embedder_config_builder.h"
#include "flutter/shell/platform/embedder/tests/embedder_test.h"
#include "flutter/shell/platform/embedder/tests/embedder_unittests_util.h"
#include "flutter/testing/assertions_skia.h"
#include "flutter/testing/testing.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/tonic/converter/dart_converter.h"

Go to the source code of this file.

Classes

struct  flutter::testing::KeyEventUserData
 

Namespaces

namespace  flutter
 
namespace  flutter::testing
 

Macros

#define FML_USED_ON_EMBEDDER
 
#define SW_PIXFMT_TEST_F(test_name, dart_entrypoint, pixfmt, matcher)
 

Functions

 flutter::testing::TEST (EmbedderTestNoFixture, MustNotRunWithInvalidArgs)
 
 flutter::testing::TEST_F (EmbedderTest, CanLaunchAndShutdownWithValidProjectArgs)
 
 flutter::testing::TEST_F (EmbedderTest, DISABLED_CanLaunchAndShutdownMultipleTimes)
 
 flutter::testing::TEST_F (EmbedderTest, CanInvokeCustomEntrypoint)
 
 flutter::testing::TEST_F (EmbedderTest, CanInvokeCustomEntrypointMacro)
 
 flutter::testing::TEST_F (EmbedderTest, CanTerminateCleanly)
 
 flutter::testing::TEST_F (EmbedderTest, ExecutableNameNotNull)
 
 flutter::testing::TEST_F (EmbedderTest, ImplicitViewNotNull)
 
 flutter::testing::TEST_F (EmbedderTest, CanSpecifyCustomPlatformTaskRunner)
 
 flutter::testing::TEST (EmbedderTestNoFixture, CanGetCurrentTimeInNanoseconds)
 
 flutter::testing::TEST_F (EmbedderTest, CanReloadSystemFonts)
 
 flutter::testing::TEST_F (EmbedderTest, IsolateServiceIdSent)
 
 flutter::testing::TEST_F (EmbedderTest, CanCreateAndCollectCallbacks)
 
 flutter::testing::TEST_F (EmbedderTest, PlatformMessagesCanReceiveResponse)
 
 flutter::testing::TEST_F (EmbedderTest, PlatformMessagesCanBeSentWithoutResponseHandles)
 
 flutter::testing::TEST_F (EmbedderTest, NullPlatformMessagesCanBeSent)
 
 flutter::testing::TEST_F (EmbedderTest, InvalidPlatformMessages)
 
 flutter::testing::TEST_F (EmbedderTest, CanSetCustomLogMessageCallback)
 
 flutter::testing::TEST_F (EmbedderTest, CanSetCustomLogTag)
 Tests that setting a custom log tag works. More...
 
 flutter::testing::TEST_F (EmbedderTest, VMShutsDownWhenNoEnginesInProcess)
 
 flutter::testing::TEST_F (EmbedderTest, DartEntrypointArgs)
 
 flutter::testing::TEST_F (EmbedderTest, VMAndIsolateSnapshotSizesAreRedundantInAOTMode)
 
 flutter::testing::TEST_F (EmbedderTest, CanRenderImplicitView)
 
 flutter::testing::TEST_F (EmbedderTest, CanRenderImplicitViewUsingPresentLayersCallback)
 
 flutter::testing::TEST_F (EmbedderTest, CompositorMustBeAbleToRenderKnownSceneWithSoftwareCompositor)
 
 flutter::testing::TEST_F (EmbedderTest, NoLayerCreatedForTransparentOverlayOnTopOfPlatformLayer)
 
 flutter::testing::TEST_F (EmbedderTest, NoLayerCreatedForNoOverlayOnTopOfPlatformLayer)
 
 flutter::testing::TEST_F (EmbedderTest, CanCreateInitializedEngine)
 
 flutter::testing::TEST_F (EmbedderTest, CanRunInitializedEngine)
 
 flutter::testing::TEST_F (EmbedderTest, CanDeinitializeAnEngine)
 
 flutter::testing::TEST_F (EmbedderTest, CanAddView)
 
 flutter::testing::TEST_F (EmbedderTest, AddViewSchedulesFrame)
 
 flutter::testing::TEST_F (EmbedderTest, CanRemoveView)
 
 flutter::testing::TEST_F (EmbedderTest, CannotRemoveImplicitView)
 
 flutter::testing::TEST_F (EmbedderTest, CannotAddDuplicateViews)
 
 flutter::testing::TEST_F (EmbedderTest, CanReuseViewIds)
 
 flutter::testing::TEST_F (EmbedderTest, CannotRemoveUnknownView)
 
 flutter::testing::TEST_F (EmbedderTest, ViewOperationsOrdered)
 
 flutter::testing::TEST_F (EmbedderTest, CanRenderMultipleViews)
 
 flutter::testing::TEST_F (EmbedderTest, BackingStoresCorrespondToTheirViews)
 
 flutter::testing::TEST_F (EmbedderTest, CanUpdateLocales)
 
 flutter::testing::TEST_F (EmbedderTest, LocalizationCallbacksCalled)
 
 flutter::testing::TEST_F (EmbedderTest, CanQueryDartAOTMode)
 
 flutter::testing::TEST_F (EmbedderTest, VerifyB143464703WithSoftwareBackend)
 
 flutter::testing::TEST_F (EmbedderTest, CanSendLowMemoryNotification)
 
 flutter::testing::TEST_F (EmbedderTest, CanPostTaskToAllNativeThreads)
 
 flutter::testing::TEST_F (EmbedderTest, InvalidAOTDataSourcesMustReturnError)
 
 flutter::testing::TEST_F (EmbedderTest, MustNotRunWithMultipleAOTSources)
 
 flutter::testing::TEST_F (EmbedderTest, CanCreateAndCollectAValidElfSource)
 
 flutter::testing::TEST_F (EmbedderTest, CanLaunchAndShutdownWithAValidElfSource)
 
 flutter::testing::TEST_F (EmbedderTest, CanSuccessfullyPopulateSpecificJITSnapshotCallbacks)
 
 flutter::testing::TEST_F (EmbedderTest, JITSnapshotCallbacksFailWithInvalidLocation)
 
 flutter::testing::TEST_F (EmbedderTest, CanLaunchEngineWithSpecifiedJITSnapshots)
 
 flutter::testing::TEST_F (EmbedderTest, CanLaunchEngineWithSomeSpecifiedJITSnapshots)
 
 flutter::testing::TEST_F (EmbedderTest, CanLaunchEngineWithInvalidJITSnapshots)
 
 flutter::testing::TEST_F (EmbedderTest, CanLaunchEngineWithUnspecifiedJITSnapshots)
 
 flutter::testing::TEST_F (EmbedderTest, InvalidFlutterWindowMetricsEvent)
 
static void flutter::testing::expectSoftwareRenderingOutputMatches (EmbedderTest &test, std::string entrypoint, FlutterSoftwarePixelFormat pixfmt, const std::vector< uint8_t > &bytes)
 
template<typename T >
static void flutter::testing::expectSoftwareRenderingOutputMatches (EmbedderTest &test, std::string entrypoint, FlutterSoftwarePixelFormat pixfmt, T pixelvalue)
 
 flutter::testing::SW_PIXFMT_TEST_F (RedRGBA565xF800, draw_solid_red, kFlutterSoftwarePixelFormatRGB565,(uint16_t) 0xF800)
 
 flutter::testing::SW_PIXFMT_TEST_F (RedRGBA4444xF00F, draw_solid_red, kFlutterSoftwarePixelFormatRGBA4444,(uint16_t) 0xF00F)
 
 flutter::testing::SW_PIXFMT_TEST_F (RedRGBA8888xFFx00x00xFF, draw_solid_red, kFlutterSoftwarePixelFormatRGBA8888,(std::vector< uint8_t >{0xFF, 0x00, 0x00, 0xFF}))
 
 flutter::testing::SW_PIXFMT_TEST_F (RedBGRA8888x00x00xFFxFF, draw_solid_red, kFlutterSoftwarePixelFormatBGRA8888,(std::vector< uint8_t >{0x00, 0x00, 0xFF, 0xFF}))
 
 flutter::testing::SW_PIXFMT_TEST_F (RedGray8x36, draw_solid_red, kFlutterSoftwarePixelFormatGray8,(uint8_t) 0x36)
 
 flutter::testing::SW_PIXFMT_TEST_F (GreenRGB565x07E0, draw_solid_green, kFlutterSoftwarePixelFormatRGB565,(uint16_t) 0x07E0)
 
 flutter::testing::SW_PIXFMT_TEST_F (GreenRGBA4444x0F0F, draw_solid_green, kFlutterSoftwarePixelFormatRGBA4444,(uint16_t) 0x0F0F)
 
 flutter::testing::SW_PIXFMT_TEST_F (GreenRGBA8888x00xFFx00xFF, draw_solid_green, kFlutterSoftwarePixelFormatRGBA8888,(std::vector< uint8_t >{0x00, 0xFF, 0x00, 0xFF}))
 
 flutter::testing::SW_PIXFMT_TEST_F (GreenBGRA8888x00xFFx00xFF, draw_solid_green, kFlutterSoftwarePixelFormatBGRA8888,(std::vector< uint8_t >{0x00, 0xFF, 0x00, 0xFF}))
 
 flutter::testing::SW_PIXFMT_TEST_F (GreenGray8xB6, draw_solid_green, kFlutterSoftwarePixelFormatGray8,(uint8_t) 0xB6)
 
 flutter::testing::SW_PIXFMT_TEST_F (BlueRGB565x001F, draw_solid_blue, kFlutterSoftwarePixelFormatRGB565,(uint16_t) 0x001F)
 
 flutter::testing::SW_PIXFMT_TEST_F (BlueRGBA4444x00FF, draw_solid_blue, kFlutterSoftwarePixelFormatRGBA4444,(uint16_t) 0x00FF)
 
 flutter::testing::SW_PIXFMT_TEST_F (BlueRGBA8888x00x00xFFxFF, draw_solid_blue, kFlutterSoftwarePixelFormatRGBA8888,(std::vector< uint8_t >{0x00, 0x00, 0xFF, 0xFF}))
 
 flutter::testing::SW_PIXFMT_TEST_F (BlueBGRA8888xFFx00x00xFF, draw_solid_blue, kFlutterSoftwarePixelFormatBGRA8888,(std::vector< uint8_t >{0xFF, 0x00, 0x00, 0xFF}))
 
 flutter::testing::SW_PIXFMT_TEST_F (BlueGray8x12, draw_solid_blue, kFlutterSoftwarePixelFormatGray8,(uint8_t) 0x12)
 
FlutterKeyEventType flutter::testing::UnserializeKeyEventType (uint64_t kind)
 
FlutterKeyEventDeviceType flutter::testing::UnserializeKeyEventDeviceType (uint64_t source)
 
void flutter::testing::ExpectKeyEventEq (const FlutterKeyEvent &subject, const FlutterKeyEvent &baseline)
 
 flutter::testing::TEST_F (EmbedderTest, KeyDataIsCorrectlySerialized)
 
 flutter::testing::TEST_F (EmbedderTest, KeyDataAreBuffered)
 
 flutter::testing::TEST_F (EmbedderTest, KeyDataResponseIsCorrectlyInvoked)
 
 flutter::testing::TEST_F (EmbedderTest, BackToBackKeyEventResponsesCorrectlyInvoked)
 
 flutter::testing::TEST_F (EmbedderTest, VsyncCallbackPostedIntoFuture)
 
 flutter::testing::TEST_F (EmbedderTest, CanScheduleFrame)
 
 flutter::testing::TEST_F (EmbedderTest, CanSetNextFrameCallback)
 
 flutter::testing::TEST_F (EmbedderTest, CanSendPointer)
 
 flutter::testing::TEST_F (EmbedderTest, CanSendPointerEventWithViewId)
 
 flutter::testing::TEST_F (EmbedderTest, WindowMetricsEventDefaultsToImplicitView)
 
 flutter::testing::TEST_F (EmbedderTest, IgnoresWindowMetricsEventForUnknownView)
 
 flutter::testing::TEST_F (EmbedderTest, RegisterChannelListener)
 
 flutter::testing::TEST_F (EmbedderTest, PlatformThreadIsolatesWithCustomPlatformTaskRunner)
 

Macro Definition Documentation

◆ FML_USED_ON_EMBEDDER

#define FML_USED_ON_EMBEDDER

Definition at line 5 of file embedder_unittests.cc.

◆ SW_PIXFMT_TEST_F

#define SW_PIXFMT_TEST_F (   test_name,
  dart_entrypoint,
  pixfmt,
  matcher 
)
Value:
TEST_F(EmbedderTest, SoftwareRenderingPixelFormats##test_name) { \
expectSoftwareRenderingOutputMatches(*this, #dart_entrypoint, pixfmt, \
matcher); \
}
testing::EmbedderTest EmbedderTest
TEST_F(EmbedderTest, PlatformThreadIsolatesWithCustomPlatformTaskRunner)

Definition at line 2771 of file embedder_unittests.cc.