summaryrefslogtreecommitdiffstats
path: root/base/path_service_unittest.cc
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 15:59:49 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-20 15:59:49 +0000
commited2f2331443f02b22b1a8051407debf03215b95d (patch)
tree04c704aa43ee77a4d44c709150495580ca289b8f /base/path_service_unittest.cc
parent173cb8a00462e07619c3de56e62dcbba56389ccc (diff)
downloadchromium_src-ed2f2331443f02b22b1a8051407debf03215b95d.zip
chromium_src-ed2f2331443f02b22b1a8051407debf03215b95d.tar.gz
chromium_src-ed2f2331443f02b22b1a8051407debf03215b95d.tar.bz2
Create a gtest test fixture subclass that allows for platform specific setup and teardown hooks. On the Mac use this to create an outer Autorelease pool.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/path_service_unittest.cc')
-rw-r--r--base/path_service_unittest.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/path_service_unittest.cc b/base/path_service_unittest.cc
index 970ea0c..ffc6992 100644
--- a/base/path_service_unittest.cc
+++ b/base/path_service_unittest.cc
@@ -31,6 +31,7 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
+#include "base/platform_test.h"
#if defined(OS_WIN)
#include "base/win_util.h"
#endif
@@ -58,11 +59,15 @@ bool ReturnsInvalidPath(int dir_type) {
} // namespace
+// On the Mac this winds up using some autoreleased objects, so we need to
+// be a PlatformTest.
+typedef PlatformTest PathServiceTest;
+
// Test that all PathService::Get calls return a value and a true result
// in the development environment. (This test was created because a few
// later changes to Get broke the semantics of the function and yielded the
// correct value while returning false.)
-TEST(PathServiceTest, Get) {
+TEST_F(PathServiceTest, Get) {
for (int key = base::DIR_CURRENT; key < base::PATH_END; ++key) {
EXPECT_PRED1(ReturnsValidPath, key);
}