summaryrefslogtreecommitdiffstats
path: root/ios/chrome/test/block_cleanup_test.h
blob: 61ec9f59be3b3d3dafaabea8baf6205ea4dcfe44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2012 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 IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_
#define IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_

#import <Foundation/Foundation.h>

#include "testing/platform_test.h"

@class NSAutoreleasePool;

// Extends PlatformTest to provide a TearDown() method that spins the runloop
// for a short time.  This allows any blocks created during tests to clean up
// after themselves.
class BlockCleanupTest : public PlatformTest {
 protected:
  void SetUp() override;
  void TearDown() override;

  void SpinRunLoop(NSTimeInterval cleanup_time);

 private:
  NSAutoreleasePool* block_cleanup_pool_;
};

#endif  // IOS_CHROME_TEST_BLOCK_CLEANUP_TEST_H_