1 // Copyright 2006-2008 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef TESTING_PLATFORM_TEST_H_
6 #define TESTING_PLATFORM_TEST_H_
8 #include <gtest/gtest.h>
10 #if defined(GTEST_OS_MAC)
11 // The purpose of this class us to provide a hook for platform-specific
12 // operations across unit tests. For example, on the Mac, it creates and
13 // releases an autorelease pool for each test case. For now, it's only
14 // implemented on the Mac. To enable this for another platform, just adjust
15 // the #ifdefs and add a platform_test_<platform>.cc implementation file.
16 class PlatformTest : public testing::Test {
18 ~PlatformTest() override;
24 void* autorelease_pool_;
28 using PlatformTest = testing::Test;
30 #endif // GTEST_OS_MAC
32 #endif // TESTING_PLATFORM_TEST_H_