michael@0: // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: michael@0: #ifndef TESTING_PLATFORM_TEST_H_ michael@0: #define TESTING_PLATFORM_TEST_H_ michael@0: michael@0: #include michael@0: michael@0: #if defined(GTEST_OS_MAC) michael@0: #ifdef __OBJC__ michael@0: @class NSAutoreleasePool; michael@0: #else michael@0: class NSAutoreleasePool; michael@0: #endif michael@0: michael@0: // The purpose of this class us to provide a hook for platform-specific michael@0: // operations across unit tests. For example, on the Mac, it creates and michael@0: // releases an outer NSAutoreleasePool for each test case. For now, it's only michael@0: // implemented on the Mac. To enable this for another platform, just adjust michael@0: // the #ifdefs and add a platform_test_.cc implementation file. michael@0: class PlatformTest : public testing::Test { michael@0: protected: michael@0: PlatformTest(); michael@0: virtual ~PlatformTest(); michael@0: michael@0: private: michael@0: NSAutoreleasePool* pool_; michael@0: }; michael@0: #else michael@0: typedef testing::Test PlatformTest; michael@0: #endif // GTEST_OS_MAC michael@0: michael@0: #endif // TESTING_PLATFORM_TEST_H_