Flutter Impeller
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 
10 namespace impeller {
11 
13  : Playground(GetParam(),
14  PlaygroundSwitches{flutter::testing::GetArgsForProcess()}) {}
15 
17 
19  if (!Playground::SupportsBackend(GetParam())) {
20  GTEST_SKIP() << "Playground doesn't support this backend type.";
21  return;
22  }
23 
25  GTEST_SKIP() << "Skipping due to user action.";
26  return;
27  }
28 
29  start_time_ = fml::TimePoint::Now().ToEpochDelta();
30 }
31 
34 }
35 
36 // |Playground|
37 std::unique_ptr<fml::Mapping> ComputePlaygroundTest::OpenAssetAsMapping(
38  std::string asset_name) const {
39  return flutter::testing::OpenFixtureAsMapping(asset_name);
40 }
41 
42 static std::string FormatWindowTitle(const std::string& test_name) {
43  std::stringstream stream;
44  stream << "Impeller Playground for '" << test_name << "' (Press ESC to quit)";
45  return stream.str();
46 }
47 
48 // |Playground|
50  return FormatWindowTitle(flutter::testing::GetCurrentTestName());
51 }
52 
53 } // namespace impeller
std::string GetWindowTitle() const override
std::unique_ptr< fml::Mapping > OpenAssetAsMapping(std::string asset_name) const override
static bool ShouldOpenNewPlaygrounds()
Definition: playground.cc:246
static bool SupportsBackend(PlaygroundBackend backend)
Definition: playground.cc:169
static std::string FormatWindowTitle(const std::string &test_name)