5 #include "flutter/fml/time/time_point.h"
17 [](
const char* message,
const char* file,
int line) ->
bool {
23 [message, file, line]() ->
void {
24 GTEST_MESSAGE_AT_(file, line,
"Impeller Validation Error",
25 ::testing::TestPartResult::kFatalFailure)
38 GTEST_SKIP() <<
"Playground doesn't support this backend type.";
43 GTEST_SKIP() <<
"Skipping due to user action.";
58 std::string asset_name)
const {
59 return flutter::testing::OpenFixtureAsMapping(asset_name);
63 const char* asset_name)
const {
64 const std::shared_ptr<fml::Mapping> fixture =
65 flutter::testing::OpenFixtureAsMapping(asset_name);
66 if (!fixture || fixture->GetSize() == 0) {
67 return absl::NotFoundError(
"Asset not found or empty.");
74 std::stringstream stream;
75 stream <<
"Impeller Playground for '"
76 << flutter::testing::GetCurrentTestName() <<
"' ";
84 stream <<
" (Angle) ";
89 stream <<
" (SwiftShader) ";
93 stream <<
" (Press ESC to quit)";
98 bool PlaygroundTest::ShouldKeepRendering()
const {
static bool ShouldOpenNewPlaygrounds()
const PlaygroundSwitches & GetSwitches() const
Return an unmodifiable reference to the current switches. The switches might change at the start of a...
void TearDownContextData()
static bool SupportsBackend(PlaygroundBackend backend)
Scalar GetSecondsElapsed() const
Get the amount of time elapsed from the start of the playground's execution.
std::unique_ptr< fml::Mapping > OpenAssetAsMapping(std::string asset_name) const override
std::string GetWindowTitle() const override
absl::StatusOr< RuntimeStage::Map > OpenAssetAsRuntimeStage(const char *asset_name) const
PlaygroundBackend GetBackend() const
virtual ~PlaygroundTest()
static absl::StatusOr< Map > DecodeRuntimeStages(const std::shared_ptr< fml::Mapping > &payload)
void ImpellerValidationErrorsSetCallback(ValidationFailureCallback callback)
Sets a callback that callers (usually tests) can set to intercept validation failures.
std::chrono::duration< float > SecondsF
std::optional< std::chrono::milliseconds > timeout