Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
linux_test.h
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
#ifndef FLUTTER_SHELL_PLATFORM_LINUX_TESTING_LINUX_TEST_H_
6
#define FLUTTER_SHELL_PLATFORM_LINUX_TESTING_LINUX_TEST_H_
7
8
#include <glib.h>
9
10
#include "
flutter/fml/macros.h
"
11
#include "
flutter/shell/platform/linux/public/flutter_linux/fl_dart_project.h
"
12
#include "
flutter/shell/platform/linux/public/flutter_linux/fl_engine.h
"
13
#include "gtest/gtest.h"
14
15
namespace
flutter
{
16
namespace
testing {
17
18
/// The base class for all Linux test fixtures.
19
///
20
/// Test fixtures for the Linux embedder should inherit from this class instead
21
/// of `::testing::Test` so that common setup is shared between them.
22
class
LinuxTest
:
public
::testing::Test {
23
public
:
24
LinuxTest
();
25
~LinuxTest
()
override
;
26
27
protected
:
28
// Frees the engine. This is done in TearDown (rather than the destructor) so
29
// that the engine is torn down while subclass members - such as GTK mocks -
30
// are still alive.
31
void
TearDown
()
override
;
32
33
// A main loop that tests can run to process asynchronous work.
34
GMainLoop*
loop
=
nullptr
;
35
36
// A Dart project that tests can use to create an engine.
37
FlDartProject*
project
=
nullptr
;
38
39
// An engine created from the above project. Subclasses that need an engine
40
// backed by a different binary messenger may replace this in SetUp.
41
FlEngine*
engine
=
nullptr
;
42
43
// Starts an engine, failing the test if it does not start. If no engine is
44
// given the engine created by the fixture is started.
45
void
StartEngine
(FlEngine*
engine
=
nullptr
);
46
47
private
:
48
FML_DISALLOW_COPY_AND_ASSIGN
(
LinuxTest
);
49
};
50
51
}
// namespace testing
52
}
// namespace flutter
53
54
#endif
// FLUTTER_SHELL_PLATFORM_LINUX_TESTING_LINUX_TEST_H_
flutter::testing::LinuxTest
Definition
linux_test.h:22
flutter::testing::LinuxTest::StartEngine
void StartEngine(FlEngine *engine=nullptr)
Definition
linux_test.cc:29
flutter::testing::LinuxTest::project
FlDartProject * project
Definition
linux_test.h:37
flutter::testing::LinuxTest::LinuxTest
LinuxTest()
Definition
linux_test.cc:13
flutter::testing::LinuxTest::engine
FlEngine * engine
Definition
linux_test.h:41
flutter::testing::LinuxTest::loop
GMainLoop * loop
Definition
linux_test.h:34
flutter::testing::LinuxTest::~LinuxTest
~LinuxTest() override
Definition
linux_test.cc:20
flutter::testing::LinuxTest::TearDown
void TearDown() override
Definition
linux_test.cc:25
fl_dart_project.h
fl_engine.h
macros.h
FML_DISALLOW_COPY_AND_ASSIGN
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:27
flutter
Definition
asset_manager.cc:10
shell
platform
linux
testing
linux_test.h
Generated on Tue Jun 30 2026 05:59:06 for Flutter Engine Uber Docs by
1.9.8