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 {
63 const char* asset_name)
const {
64 const std::shared_ptr<fml::Mapping> fixture =
66 if (!fixture || fixture->GetSize() == 0) {
67 return absl::NotFoundError(
"Asset not found or empty.");
74 std::stringstream stream;
75 stream <<
"Impeller Playground for '"
84 stream <<
" (Angle) ";
89 stream <<
" (SwiftShader) ";
93 stream <<
" (Press ESC to quit)";
98bool PlaygroundTest::ShouldKeepRendering()
const {
static bool ShouldOpenNewPlaygrounds()
void TearDownContextData()
static bool SupportsBackend(PlaygroundBackend backend)
const PlaygroundSwitches & GetSwitches() const
Return an unmodifiable reference to the current switches. The switches might change at the start of a...
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)
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
std::unique_ptr< fml::Mapping > OpenFixtureAsMapping(const std::string &fixture_name)
Opens a fixture of the given file name and returns a mapping to its contents.
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