Commit cc331493 authored by stkhapugin's avatar stkhapugin Committed by Commit bot

Modifies BlockCleanupTest so that it can be used from ARC code.

Since ARC code cannot refer to NSAutoreleasePool directly, before this
change block_cleanup_test.h cannot be included from ARC-enabled code.
With this change, the header lists block_cleanup_pool_ as id, which
allows such includes.

BUG=None

Review-Url: https://codereview.chromium.org/2623233002
Cr-Commit-Position: refs/heads/master@{#442927}
parent ba3e738c
...@@ -22,7 +22,7 @@ class BlockCleanupTest : public PlatformTest { ...@@ -22,7 +22,7 @@ class BlockCleanupTest : public PlatformTest {
void SpinRunLoop(NSTimeInterval cleanup_time); void SpinRunLoop(NSTimeInterval cleanup_time);
private: private:
NSAutoreleasePool* block_cleanup_pool_; id block_cleanup_pool_;
}; };
#endif // IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_ #endif // IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/logging.h" #include "base/logging.h"
#import "base/mac/scoped_nsobject.h" #import "base/mac/scoped_nsobject.h"
#import "base/mac/foundation_util.h"
void BlockCleanupTest::SetUp() { void BlockCleanupTest::SetUp() {
block_cleanup_pool_ = [[NSAutoreleasePool alloc] init]; block_cleanup_pool_ = [[NSAutoreleasePool alloc] init];
...@@ -22,7 +23,7 @@ void BlockCleanupTest::TearDown() { ...@@ -22,7 +23,7 @@ void BlockCleanupTest::TearDown() {
// Drain the autorelease pool to finish cleaning up after blocks. // Drain the autorelease pool to finish cleaning up after blocks.
// TODO(rohitrao): Can this be an EXPECT, so as to not crash the whole suite? // TODO(rohitrao): Can this be an EXPECT, so as to not crash the whole suite?
DCHECK(block_cleanup_pool_); DCHECK(block_cleanup_pool_);
[block_cleanup_pool_ release]; [base::mac::ObjCCastStrict<NSAutoreleasePool>(block_cleanup_pool_) release];
block_cleanup_pool_ = nil; block_cleanup_pool_ = nil;
PlatformTest::TearDown(); PlatformTest::TearDown();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment