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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/mac/closure_blocks_leopard_compat.S ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc
===================================================================
--- chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc (revision 0)
+++ chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc (revision 0)
@@ -0,0 +1,31 @@
+// Copyright (c) 2011 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.
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+#include "base/mac/mac_util.h"
+#include "chrome/browser/mac/closure_blocks_leopard_compat.h"
+
+namespace {
+
+// It should be possible to declare a block on OSes as early as Leopard
+// (10.5). This should be buildable with the 10.5 SDK and a 10.5 deployment
+// target, and runnable on 10.5. However, the block itself is not expected to
+// be runnable on 10.5. This test verfies that blocks are buildable on 10.5
+// and runnable on Snow Leopard (10.6) and later.
+TEST(ClosureBlocksLeopardCompatTest, Basic) {
+ bool ran = false;
+
+ void (^test_block)(bool*) = ^(bool* ran_pointer) { *ran_pointer = true; };
+
+ ASSERT_FALSE(ran);
+
+ if (base::mac::IsOSSnowLeopardOrLater()) {
+ test_block(&ran);
+
+ ASSERT_TRUE(ran);
+ }
+}
+
+} // namespace
Property changes on: chrome/browser/mac/closure_blocks_leopard_compat_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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