Flutter Engine
flutter::testing::EmbedderTest Class Reference

#include <embedder_test.h>

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

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 (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 19 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 25 of file embedder_test.cc.

References FML_DCHECK, GetFixturesDirectory(), flutter::testing::kMetalContext, flutter::testing::kOpenGLContext, flutter::testing::kSoftwareContext, and type.

26  {
27  // Setup the embedder context lazily instead of in the constructor because we
28  // don't to do all the work if the test won't end up using context.
29  if (!embedder_contexts_[type]) {
30  switch (type) {
32  embedder_contexts_[type] =
33  std::make_unique<EmbedderTestContextSoftware>(
35  break;
36 #ifdef SHELL_ENABLE_GL
38  embedder_contexts_[type] =
39  std::make_unique<EmbedderTestContextGL>(GetFixturesDirectory());
40  break;
41 #endif
42 #ifdef SHELL_ENABLE_METAL
44  embedder_contexts_[type] =
45  std::make_unique<EmbedderTestContextMetal>(GetFixturesDirectory());
46  break;
47 #endif
48  default:
49  FML_DCHECK(false) << "Invalid context type specified.";
50  break;
51  }
52  }
53 
54  return *embedder_contexts_[type];
55 }
std::string GetFixturesDirectory() const
#define FML_DCHECK(condition)
Definition: logging.h:86
GdkEventType type
Definition: fl_view.cc:80

◆ GetFixturesDirectory()

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

Definition at line 21 of file embedder_test.cc.

References flutter::testing::GetFixturesPath().

Referenced by GetEmbedderContext().

21  {
22  return GetFixturesPath();
23 }
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: