[go: nahoru, domu]

Move NSAutoreleasePool management into the PlatformTest constructor and
destructor.  The pool operations are moving from SetUp and TearDown, which are
scoped slightly too narrowly for our needs.  Using the constructor and
destructor ensures that the pools properly bracket tests.
Review URL: http://codereview.chromium.org/174171

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23897 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/testing/platform_test_mac.mm b/testing/platform_test_mac.mm
index e4aaeabb..bd22cd5 100644
--- a/testing/platform_test_mac.mm
+++ b/testing/platform_test_mac.mm
@@ -6,10 +6,10 @@
 
 #import <Foundation/Foundation.h>
 
-void PlatformTest::SetUp() {
-  pool_ = [[NSAutoreleasePool alloc] init];
+PlatformTest::PlatformTest()
+    : pool_([[NSAutoreleasePool alloc] init]) {
 }
 
-void PlatformTest::TearDown() {
-  [pool_ drain];
+PlatformTest::~PlatformTest() {
+  [pool_ release];
 }