summaryrefslogtreecommitdiffstats
path: root/testing/platform_test.h
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 19:20:15 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-02 19:20:15 +0000
commit23887f04fbf1ddadadea709206b265a3def2eb3a (patch)
treeb93cf25e8cc66180137fea6c5aad4148ec70fd58 /testing/platform_test.h
parent07c3f84910a6bc63a69d5f7fe0725090cf2af1ce (diff)
downloadchromium_src-23887f04fbf1ddadadea709206b265a3def2eb3a.zip
chromium_src-23887f04fbf1ddadadea709206b265a3def2eb3a.tar.gz
chromium_src-23887f04fbf1ddadadea709206b265a3def2eb3a.tar.bz2
* Cleanup: move base/platform_test.h -> testing/
* Add support for "Debug On Start" switch to MultiprocessTest::SpawnChild Review URL: http://codereview.chromium.org/13052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6227 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/platform_test.h')
-rw-r--r--testing/platform_test.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/testing/platform_test.h b/testing/platform_test.h
new file mode 100644
index 0000000..6e5e039
--- /dev/null
+++ b/testing/platform_test.h
@@ -0,0 +1,36 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TESTING_PLATFORM_TEST_H_
+#define TESTING_PLATFORM_TEST_H_
+
+#include <gtest/gtest.h>
+
+#if defined(GTEST_OS_MAC)
+#ifdef __OBJC__
+@class NSAutoreleasePool;
+#else
+class NSAutoreleasePool;
+#endif
+
+// The purpose of this class us to provide a hook for platform-specific
+// SetUp and TearDown across unit tests. For example, on the Mac, it
+// creates and releases an outer AutoreleasePool for each test. For now, it's
+// only implemented on the Mac. To enable this for another platform, just
+// adjust the #ifdefs and add a platform_test_<platform>.cc implementation file.
+class PlatformTest : public testing::Test {
+ protected:
+ virtual void SetUp();
+ virtual void TearDown();
+
+ private:
+ NSAutoreleasePool* pool_;
+};
+#else
+typedef testing::Test PlatformTest;
+#endif // GTEST_OS_MAC
+
+#endif // TESTING_PLATFORM_TEST_H_
+
+