Flutter Engine
 
Loading...
Searching...
No Matches
flutter::testing::EmbedderTest Class Reference

#include <embedder_test.h>

Inheritance diagram for flutter::testing::EmbedderTest:
flutter::testing::ThreadTest flutter::testing::EmbedderTestMultiBackend

Public Member Functions

 EmbedderTest ()
 
std::string GetFixturesDirectory () const
 
template<typename T >
T & GetEmbedderContext ()
 
template<>
EmbedderTestContextGLGetEmbedderContext ()
 
template<>
EmbedderTestContextMetalGetEmbedderContext ()
 
template<>
EmbedderTestContextSoftwareGetEmbedderContext ()
 
template<>
EmbedderTestContextVulkanGetEmbedderContext ()
 
- Public Member Functions inherited from flutter::testing::ThreadTest
 ThreadTest ()
 
fml::RefPtr< fml::TaskRunnerGetCurrentTaskRunner ()
 Get the task runner for the thread that the current unit-test is running on. This creates a message loop as necessary.
 
fml::RefPtr< fml::TaskRunnerCreateNewThread (const std::string &name="")
 Creates a new thread, initializes a message loop on it, and, returns its task runner to the unit-test. The message loop is terminated (and its thread joined) when the test ends. This allows tests to create multiple named threads as necessary.
 

Protected Member Functions

EmbedderTestContextGetGLContext ()
 
EmbedderTestContextGetMetalContext ()
 
EmbedderTestContextGetSoftwareContext ()
 
EmbedderTestContextGetVulkanContext ()
 
 FML_DISALLOW_COPY_AND_ASSIGN (EmbedderTest)
 

Protected Attributes

std::unique_ptr< EmbedderTestContextgl_context_
 
std::unique_ptr< EmbedderTestContextmetal_context_
 
std::unique_ptr< EmbedderTestContextsoftware_context_
 
std::unique_ptr< EmbedderTestContextvulkan_context_
 

Detailed Description

Definition at line 24 of file embedder_test.h.

Constructor & Destructor Documentation

◆ EmbedderTest()

flutter::testing::EmbedderTest::EmbedderTest ( )
default

Member Function Documentation

◆ FML_DISALLOW_COPY_AND_ASSIGN()

flutter::testing::EmbedderTest::FML_DISALLOW_COPY_AND_ASSIGN ( EmbedderTest  )
protected

◆ GetEmbedderContext() [1/5]

template<typename T >
T & flutter::testing::EmbedderTest::GetEmbedderContext ( )
inline

Definition at line 31 of file embedder_test.h.

31 {
32 static_assert(false, "Unsupported test context type");
33 }

Referenced by flutter::testing::expectSoftwareRenderingOutputMatches().

◆ GetEmbedderContext() [2/5]

template<>
EmbedderTestContextGL & flutter::testing::EmbedderTest::GetEmbedderContext ( )
inline

Definition at line 36 of file embedder_test.h.

36 {
37 return reinterpret_cast<EmbedderTestContextGL&>(GetGLContext());
38 }
EmbedderTestContext & GetGLContext()

References GetGLContext().

◆ GetEmbedderContext() [3/5]

template<>
EmbedderTestContextMetal & flutter::testing::EmbedderTest::GetEmbedderContext ( )
inline

Definition at line 41 of file embedder_test.h.

41 {
42 return reinterpret_cast<EmbedderTestContextMetal&>(GetMetalContext());
43 }
EmbedderTestContext & GetMetalContext()

References GetMetalContext().

◆ GetEmbedderContext() [4/5]

template<>
EmbedderTestContextSoftware & flutter::testing::EmbedderTest::GetEmbedderContext ( )
inline

Definition at line 46 of file embedder_test.h.

47 {
48 return reinterpret_cast<EmbedderTestContextSoftware&>(GetSoftwareContext());
49 }
EmbedderTestContext & GetSoftwareContext()

References GetSoftwareContext().

◆ GetEmbedderContext() [5/5]

template<>
EmbedderTestContextVulkan & flutter::testing::EmbedderTest::GetEmbedderContext ( )
inline

Definition at line 52 of file embedder_test.h.

52 {
53 return reinterpret_cast<EmbedderTestContextVulkan&>(GetVulkanContext());
54 }
EmbedderTestContext & GetVulkanContext()

References GetVulkanContext().

◆ GetFixturesDirectory()

std::string flutter::testing::EmbedderTest::GetFixturesDirectory ( ) const

Definition at line 16 of file embedder_test.cc.

16 {
17 return GetFixturesPath();
18}
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...

References flutter::testing::GetFixturesPath().

Referenced by GetSoftwareContext().

◆ GetGLContext()

EmbedderTestContext & flutter::testing::EmbedderTest::GetGLContext ( )
protected

Definition at line 31 of file embedder_test.cc.

31 {
32 FML_LOG(FATAL) << "OpenGL is not supported in this build";
33 std::terminate();
34}
#define FML_LOG(severity)
Definition logging.h:101

References FML_LOG.

Referenced by GetEmbedderContext(), and flutter::testing::EmbedderTestMultiBackend::GetEmbedderContext().

◆ GetMetalContext()

EmbedderTestContext & flutter::testing::EmbedderTest::GetMetalContext ( )
protected

Definition at line 40 of file embedder_test.cc.

40 {
41 FML_LOG(FATAL) << "Metal is not supported in this build";
42 std::terminate();
43}

References FML_LOG.

Referenced by GetEmbedderContext(), and flutter::testing::EmbedderTestMultiBackend::GetEmbedderContext().

◆ GetSoftwareContext()

EmbedderTestContext & flutter::testing::EmbedderTest::GetSoftwareContext ( )
protected

Definition at line 20 of file embedder_test.cc.

20 {
21 if (!software_context_) {
23 std::make_unique<EmbedderTestContextSoftware>(GetFixturesDirectory());
24 }
25 return *software_context_.get();
26}
std::unique_ptr< EmbedderTestContext > software_context_
std::string GetFixturesDirectory() const

References GetFixturesDirectory(), and software_context_.

Referenced by GetEmbedderContext(), and flutter::testing::EmbedderTestMultiBackend::GetEmbedderContext().

◆ GetVulkanContext()

EmbedderTestContext & flutter::testing::EmbedderTest::GetVulkanContext ( )
protected

Definition at line 49 of file embedder_test.cc.

49 {
50 FML_LOG(FATAL) << "Vulkan is not supported in this build";
51 std::terminate();
52}

References FML_LOG.

Referenced by GetEmbedderContext(), and flutter::testing::EmbedderTestMultiBackend::GetEmbedderContext().

Member Data Documentation

◆ gl_context_

std::unique_ptr<EmbedderTestContext> flutter::testing::EmbedderTest::gl_context_
protected

Definition at line 68 of file embedder_test.h.

◆ metal_context_

std::unique_ptr<EmbedderTestContext> flutter::testing::EmbedderTest::metal_context_
protected

Definition at line 69 of file embedder_test.h.

◆ software_context_

std::unique_ptr<EmbedderTestContext> flutter::testing::EmbedderTest::software_context_
protected

Definition at line 70 of file embedder_test.h.

Referenced by GetSoftwareContext().

◆ vulkan_context_

std::unique_ptr<EmbedderTestContext> flutter::testing::EmbedderTest::vulkan_context_
protected

Definition at line 71 of file embedder_test.h.


The documentation for this class was generated from the following files: