OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_ | 5 #ifndef IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_ |
6 #define IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_ | 6 #define IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #include "testing/platform_test.h" | 10 #include "testing/platform_test.h" |
11 | 11 |
12 @class NSAutoreleasePool; | 12 @class NSAutoreleasePool; |
13 | 13 |
14 // Extends PlatformTest to provide a TearDown() method that spins the runloop | 14 // Extends PlatformTest to provide a TearDown() method that spins the runloop |
15 // for a short time. This allows any blocks created during tests to clean up | 15 // for a short time. This allows any blocks created during tests to clean up |
16 // after themselves. | 16 // after themselves. |
17 class BlockCleanupTest : public PlatformTest { | 17 class BlockCleanupTest : public PlatformTest { |
18 protected: | 18 protected: |
19 void SetUp() override; | 19 void SetUp() override; |
20 void TearDown() override; | 20 void TearDown() override; |
21 | 21 |
22 void SpinRunLoop(NSTimeInterval cleanup_time); | 22 void SpinRunLoop(NSTimeInterval cleanup_time); |
23 | 23 |
24 private: | 24 private: |
25 NSAutoreleasePool* block_cleanup_pool_; | 25 id block_cleanup_pool_; |
26 }; | 26 }; |
27 | 27 |
28 #endif // IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_ | 28 #endif // IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_ |
OLD | NEW |