Flutter Engine
The Flutter Engine
compute_playground_test.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/fml/time/time_point.h"
6
7#include "flutter/testing/test_args.h"
9
10namespace impeller {
11
14
16
18 if (!Playground::SupportsBackend(GetParam())) {
19 GTEST_SKIP_("Playground doesn't support this backend type.");
20 return;
21 }
22
24 GTEST_SKIP_("Skipping due to user action.");
25 return;
26 }
27
28 SetupContext(GetParam(), switches_);
30
31 start_time_ = fml::TimePoint::Now().ToEpochDelta();
32}
33
36}
37
38// |Playground|
39std::unique_ptr<fml::Mapping> ComputePlaygroundTest::OpenAssetAsMapping(
40 std::string asset_name) const {
42}
43
44static std::string FormatWindowTitle(const std::string& test_name) {
45 std::stringstream stream;
46 stream << "Impeller Playground for '" << test_name << "' (Press ESC to quit)";
47 return stream.str();
48}
49
50// |Playground|
53}
54
55} // namespace impeller
TimeDelta ToEpochDelta() const
Definition: time_point.h:52
static TimePoint Now()
Definition: time_point.cc:49
std::string GetWindowTitle() const override
std::unique_ptr< fml::Mapping > OpenAssetAsMapping(std::string asset_name) const override
static bool ShouldOpenNewPlaygrounds()
Definition: playground.cc:167
void SetupContext(PlaygroundBackend backend, const PlaygroundSwitches &switches)
Definition: playground.cc:124
const PlaygroundSwitches switches_
Definition: playground.h:118
static bool SupportsBackend(PlaygroundBackend backend)
Definition: playground.cc:100
std::string GetCurrentTestName()
Gets the name of the currently running test. This is useful in generating logs or assets based on tes...
Definition: testing.cc:15
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.
Definition: testing.cc:59
const fml::CommandLine & GetArgsForProcess()
Definition: test_args.cc:12
static std::string FormatWindowTitle(const std::string &test_name)