Flutter Engine
 
Loading...
Searching...
No Matches
embedder_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
6
7#include <exception>
8#include <utility>
9
11
12namespace flutter::testing {
13
15
17 return GetFixturesPath();
18}
19
21 if (!software_context_) {
23 std::make_unique<EmbedderTestContextSoftware>(GetFixturesDirectory());
24 }
25 return *software_context_.get();
26}
27
28#ifndef SHELL_ENABLE_GL
29// Fallback implementation.
30// See: flutter/shell/platform/embedder/tests/embedder_test_gl.cc.
32 FML_LOG(FATAL) << "OpenGL is not supported in this build";
33 std::terminate();
34}
35#endif
36
37#ifndef SHELL_ENABLE_METAL
38// Fallback implementation.
39// See: flutter/shell/platform/embedder/tests/embedder_test_metal.mm.
41 FML_LOG(FATAL) << "Metal is not supported in this build";
42 std::terminate();
43}
44#endif
45
46#ifndef SHELL_ENABLE_VULKAN
47// Fallback implementation.
48// See: flutter/shell/platform/embedder/tests/embedder_test_vulkan.cc.
50 FML_LOG(FATAL) << "Vulkan is not supported in this build";
51 std::terminate();
52}
53#endif
54
68
69} // namespace flutter::testing
GLenum type
std::unique_ptr< EmbedderTestContext > software_context_
std::string GetFixturesDirectory() const
EmbedderTestContext & GetGLContext()
EmbedderTestContext & GetMetalContext()
EmbedderTestContext & GetVulkanContext()
EmbedderTestContext & GetSoftwareContext()
#define FML_LOG(severity)
Definition logging.h:101
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...