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"
13#include "gtest/gtest.h"
14
15namespace flutter {
16namespace 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.
22class 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:
49};
50
51} // namespace testing
52} // namespace flutter
53
54#endif // FLUTTER_SHELL_PLATFORM_LINUX_TESTING_LINUX_TEST_H_
void StartEngine(FlEngine *engine=nullptr)
Definition linux_test.cc:29
FlDartProject * project
Definition linux_test.h:37
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27