Flutter Engine
The Flutter Engine
autoreleasepool_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_TESTING_AUTORELEASEPOOL_TEST_H_
6#define FLUTTER_TESTING_AUTORELEASEPOOL_TEST_H_
7
8#include "flutter/fml/platform/darwin/scoped_nsautorelease_pool.h"
9
10#include "gtest/gtest.h"
11
12namespace flutter::testing {
13
14// GoogleTest mixin that runs the test within the scope of an NSAutoReleasePool.
15//
16// This can be mixed into test fixture classes that also inherit from gtest's
17// ::testing::Test base class.
19 public:
22
23 private:
24 fml::ScopedNSAutoreleasePool autorelease_pool_;
25
26 FML_DISALLOW_COPY_AND_ASSIGN(AutoreleasePoolTestMixin);
27};
28
29// GoogleTest fixture that runs the test within the scope of an
30// NSAutoReleasePool.
31class AutoreleasePoolTest : public ::testing::Test,
33 public:
36
37 private:
38 fml::ScopedNSAutoreleasePool autorelease_pool_;
39
40 FML_DISALLOW_COPY_AND_ASSIGN(AutoreleasePoolTest);
41};
42
43} // namespace flutter::testing
44
45#endif // FLUTTER_TESTING_AUTORELEASEPOOL_TEST_H_