blob: f10a938ab63ea851c8afe6236455330a51d59848 [file] [log] [blame]
[email protected]b2e97292008-09-02 18:20:341// Copyright (c) 2006-2008 The Chromium 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
[email protected]23887f04f2008-12-02 19:20:155#ifndef TESTING_PLATFORM_TEST_H_
6#define TESTING_PLATFORM_TEST_H_
[email protected]b2e97292008-09-02 18:20:347
[email protected]23887f04f2008-12-02 19:20:158#include <gtest/gtest.h>
[email protected]b2e97292008-09-02 18:20:349
[email protected]23887f04f2008-12-02 19:20:1510#if defined(GTEST_OS_MAC)
[email protected]b2e97292008-09-02 18:20:3411#ifdef __OBJC__
12@class NSAutoreleasePool;
13#else
14class NSAutoreleasePool;
15#endif
16
17// The purpose of this class us to provide a hook for platform-specific
[email protected]c77043fc2009-08-20 22:37:5918// operations across unit tests. For example, on the Mac, it creates and
19// releases an outer NSAutoreleasePool for each test case. For now, it's only
20// implemented on the Mac. To enable this for another platform, just adjust
21// the #ifdefs and add a platform_test_<platform>.cc implementation file.
[email protected]b2e97292008-09-02 18:20:3422class PlatformTest : public testing::Test {
[email protected]f0a51fb52009-03-05 12:46:3823 protected:
[email protected]c77043fc2009-08-20 22:37:5924 PlatformTest();
25 virtual ~PlatformTest();
[email protected]b2e97292008-09-02 18:20:3426
27 private:
28 NSAutoreleasePool* pool_;
29};
30#else
31typedef testing::Test PlatformTest;
[email protected]23887f04f2008-12-02 19:20:1532#endif // GTEST_OS_MAC
[email protected]b2e97292008-09-02 18:20:3433
[email protected]23887f04f2008-12-02 19:20:1534#endif // TESTING_PLATFORM_TEST_H_