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

Side by Side Diff: chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc

Issue 7582032: Allow use of ^blocks, even with the 10.5 SDK, and even with a 10.5 runtime (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/mac/closure_blocks_leopard_compat.S ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "testing/gtest/include/gtest/gtest.h"
6
7 #include "base/mac/mac_util.h"
8 #include "chrome/browser/mac/closure_blocks_leopard_compat.h"
9
10 namespace {
11
12 // It should be possible to declare a block on OSes as early as Leopard
13 // (10.5). This should be buildable with the 10.5 SDK and a 10.5 deployment
14 // target, and runnable on 10.5. However, the block itself is not expected to
15 // be runnable on 10.5. This test verfies that blocks are buildable on 10.5
16 // and runnable on Snow Leopard (10.6) and later.
17 TEST(ClosureBlocksLeopardCompatTest, Basic) {
18 bool ran = false;
19
20 void (^test_block)(bool*) = ^(bool* ran_pointer) { *ran_pointer = true; };
21
22 ASSERT_FALSE(ran);
23
24 if (base::mac::IsOSSnowLeopardOrLater()) {
25 test_block(&ran);
26
27 ASSERT_TRUE(ran);
28 }
29 }
30
31 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/mac/closure_blocks_leopard_compat.S ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698