Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | |
michael@0 | 5 | #ifndef TESTING_PLATFORM_TEST_H_ |
michael@0 | 6 | #define TESTING_PLATFORM_TEST_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include <gtest/gtest.h> |
michael@0 | 9 | |
michael@0 | 10 | #if defined(GTEST_OS_MAC) |
michael@0 | 11 | #ifdef __OBJC__ |
michael@0 | 12 | @class NSAutoreleasePool; |
michael@0 | 13 | #else |
michael@0 | 14 | class NSAutoreleasePool; |
michael@0 | 15 | #endif |
michael@0 | 16 | |
michael@0 | 17 | // The purpose of this class us to provide a hook for platform-specific |
michael@0 | 18 | // operations across unit tests. For example, on the Mac, it creates and |
michael@0 | 19 | // releases an outer NSAutoreleasePool for each test case. For now, it's only |
michael@0 | 20 | // implemented on the Mac. To enable this for another platform, just adjust |
michael@0 | 21 | // the #ifdefs and add a platform_test_<platform>.cc implementation file. |
michael@0 | 22 | class PlatformTest : public testing::Test { |
michael@0 | 23 | protected: |
michael@0 | 24 | PlatformTest(); |
michael@0 | 25 | virtual ~PlatformTest(); |
michael@0 | 26 | |
michael@0 | 27 | private: |
michael@0 | 28 | NSAutoreleasePool* pool_; |
michael@0 | 29 | }; |
michael@0 | 30 | #else |
michael@0 | 31 | typedef testing::Test PlatformTest; |
michael@0 | 32 | #endif // GTEST_OS_MAC |
michael@0 | 33 | |
michael@0 | 34 | #endif // TESTING_PLATFORM_TEST_H_ |