Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: testing/platform_test.h

Issue 2121893003: Declare pool_ as id instead of NSAutoreleasePool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 TESTING_PLATFORM_TEST_H_ 5 #ifndef TESTING_PLATFORM_TEST_H_
6 #define TESTING_PLATFORM_TEST_H_ 6 #define TESTING_PLATFORM_TEST_H_
7 7
8 #include <gtest/gtest.h> 8 #include <gtest/gtest.h>
9 9
10 #if defined(GTEST_OS_MAC) 10 #if defined(GTEST_OS_MAC)
11 #ifdef __OBJC__ 11 #ifndef __OBJC__
12 @class NSAutoreleasePool; 12 typedef void* id;
13 #else
14 class NSAutoreleasePool;
15 #endif 13 #endif
16 14
17 // The purpose of this class us to provide a hook for platform-specific 15 // The purpose of this class us to provide a hook for platform-specific
18 // operations across unit tests. For example, on the Mac, it creates and 16 // operations across unit tests. For example, on the Mac, it creates and
19 // releases an outer NSAutoreleasePool for each test case. For now, it's only 17 // releases an outer NSAutoreleasePool for each test case. For now, it's only
20 // implemented on the Mac. To enable this for another platform, just adjust 18 // implemented on the Mac. To enable this for another platform, just adjust
21 // the #ifdefs and add a platform_test_<platform>.cc implementation file. 19 // the #ifdefs and add a platform_test_<platform>.cc implementation file.
22 class PlatformTest : public testing::Test { 20 class PlatformTest : public testing::Test {
23 public: 21 public:
24 virtual ~PlatformTest(); 22 virtual ~PlatformTest();
25 23
26 protected: 24 protected:
27 PlatformTest(); 25 PlatformTest();
28 26
29 private: 27 private:
30 NSAutoreleasePool* pool_; 28 // |pool_| is a NSAutoreleasePool, but since this header may be imported from
29 // files built with Objective-C ARC that forbids explicit usage of
30 // NSAutoreleasePools, it is declared as id here.
31 id pool_;
31 }; 32 };
32 #else 33 #else
33 typedef testing::Test PlatformTest; 34 typedef testing::Test PlatformTest;
34 #endif // GTEST_OS_MAC 35 #endif // GTEST_OS_MAC
35 36
36 #endif // TESTING_PLATFORM_TEST_H_ 37 #endif // TESTING_PLATFORM_TEST_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698