Flutter Engine
The Flutter Engine
windows_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_WINDOWS_TESTING_WINDOWS_TEST_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_WINDOWS_TEST_H_
7
8#include <string>
9
10#include "flutter/fml/macros.h"
11#include "flutter/shell/platform/windows/testing/windows_test_context.h"
12#include "flutter/testing/thread_test.h"
13
14namespace flutter {
15namespace testing {
16
17/// A GoogleTest test fixture for Windows tests.
18///
19/// Supports looking up the test fixture data defined in the GN `test_fixtures`
20/// associated with the unit test executable target. This typically includes
21/// the kernel bytecode `kernel_blob.bin` compiled from the Dart file specified
22/// in the test fixture's `dart_main` property, as well as any other data files
23/// used in tests, such as image files used in a screenshot golden test.
24///
25/// This test class can be used in GoogleTest tests using the standard
26/// `TEST_F(WindowsTest, TestName)` macro.
27class WindowsTest : public ThreadTest {
28 public:
30
31 // Returns the path to test fixture data such as kernel bytecode or images
32 // used by the C++ side of the test.
33 std::string GetFixturesDirectory() const;
34
35 // Returns the test context associated with this fixture.
37
38 private:
39 WindowsTestContext context_;
40
41 FML_DISALLOW_COPY_AND_ASSIGN(WindowsTest);
42};
43
44} // namespace testing
45} // namespace flutter
46
47#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_TESTING_WINDOWS_TEST_H_
A fixture that creates threads with running message loops that are terminated when the test is done (...
Definition: thread_test.h:27
std::string GetFixturesDirectory() const
Definition: windows_test.cc:17
WindowsTestContext & GetContext()
Definition: windows_test.cc:21