1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/webrtc/trunk/testing/platform_test.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +#ifndef TESTING_PLATFORM_TEST_H_ 1.9 +#define TESTING_PLATFORM_TEST_H_ 1.10 + 1.11 +#include <gtest/gtest.h> 1.12 + 1.13 +#if defined(GTEST_OS_MAC) 1.14 +#ifdef __OBJC__ 1.15 +@class NSAutoreleasePool; 1.16 +#else 1.17 +class NSAutoreleasePool; 1.18 +#endif 1.19 + 1.20 +// The purpose of this class us to provide a hook for platform-specific 1.21 +// operations across unit tests. For example, on the Mac, it creates and 1.22 +// releases an outer NSAutoreleasePool for each test case. For now, it's only 1.23 +// implemented on the Mac. To enable this for another platform, just adjust 1.24 +// the #ifdefs and add a platform_test_<platform>.cc implementation file. 1.25 +class PlatformTest : public testing::Test { 1.26 + protected: 1.27 + PlatformTest(); 1.28 + virtual ~PlatformTest(); 1.29 + 1.30 + private: 1.31 + NSAutoreleasePool* pool_; 1.32 +}; 1.33 +#else 1.34 +typedef testing::Test PlatformTest; 1.35 +#endif // GTEST_OS_MAC 1.36 + 1.37 +#endif // TESTING_PLATFORM_TEST_H_