Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
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
 
EmbedderTestContextGetEmbedderContext (EmbedderTestContextType type)
 
- 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. More...
 
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. More...
 

Detailed Description

Definition at line 20 of file embedder_test.h.

Constructor & Destructor Documentation

◆ EmbedderTest()

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

Member Function Documentation

◆ GetEmbedderContext()

EmbedderTestContext & flutter::testing::EmbedderTest::GetEmbedderContext ( EmbedderTestContextType  type)

Definition at line 29 of file embedder_test.cc.

30 {
31 // Setup the embedder context lazily instead of in the constructor because we
32 // don't to do all the work if the test won't end up using context.
33 if (!embedder_contexts_[type]) {
34 switch (type) {
36 embedder_contexts_[type] =
37 std::make_unique<EmbedderTestContextSoftware>(
39 break;
40#ifdef SHELL_ENABLE_VULKAN
42 embedder_contexts_[type] =
43 std::make_unique<EmbedderTestContextVulkan>(GetFixturesDirectory());
44 break;
45#endif
46#ifdef SHELL_ENABLE_GL
48 embedder_contexts_[type] =
49 std::make_unique<EmbedderTestContextGL>(GetFixturesDirectory());
50 break;
51#endif
52#ifdef SHELL_ENABLE_METAL
54 embedder_contexts_[type] =
55 std::make_unique<EmbedderTestContextMetal>(GetFixturesDirectory());
56 break;
57#endif
58 default:
59 FML_DCHECK(false) << "Invalid context type specified.";
60 break;
61 }
62 }
63
64 return *embedder_contexts_[type];
65}
GLenum type
std::string GetFixturesDirectory() const
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ GetFixturesDirectory()

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

Definition at line 25 of file embedder_test.cc.

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

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